/* Substitutions (task 823.6): the "Swaps" pop-over on recipe and cook pages, and the /substitutions pages. Colors come
   from site.css. Loaded on recipe, cook and substitution pages only. */
.ing-list li.has-swap, .checklist li.has-swap { position: relative; display: flex; align-items: flex-start; gap: 8px; }
.ing-list li.has-swap .ing-text { flex: 1; min-width: 0; }
.checklist li.has-swap label { flex: 1; min-width: 0; }
.swap { flex: none; }
.swap-btn { list-style: none; display: inline-flex; align-items: center; gap: 4px; min-height: 32px; padding: 2px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--link); font-size: .82rem; font-weight: 600; cursor: pointer; white-space: nowrap; user-select: none; }
.swap-btn::-webkit-details-marker { display: none; }
.swap-btn::before { content: ""; width: 16px; height: 16px; flex: none; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 8h13l-3.5-3.5M20 16H7l3.5 3.5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M4 8h13l-3.5-3.5M20 16H7l3.5 3.5' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat; }
.swap-btn:hover { border-color: var(--accent); }
.swap[open] .swap-btn { background: var(--honey-soft); color: var(--ink); border-color: var(--honey); }
.checklist .swap { align-self: center; margin-right: 8px; }
.checklist .swap-btn { min-height: 40px; font-size: .95rem; }
.swap-pop { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% - 4px); background: var(--surface); color: var(--ink); border: 1px solid var(--line); border-left: 5px solid var(--honey); border-radius: 12px; box-shadow: var(--shadow); padding: 12px 16px; font-size: .93rem; line-height: 1.5; }
.checklist .swap-pop { font-size: 1rem; }
.swap-h { font: 700 .78rem var(--sans); text-transform: uppercase; letter-spacing: .07em; color: var(--accent); margin: 0 0 4px; }
.swap-list, .swap-pop ul { list-style: none; padding: 0; margin: 0 0 6px; display: grid; gap: 6px; }
.swap-list li, .swap-pop li { padding: 0; border: 0; }
.swap-pop li > span { color: var(--muted); }
.swap-more { margin: 0 0 4px; font-size: .88rem; font-weight: 600; }
.swap-note { margin: 4px 0 0; font-size: .85rem; color: var(--muted); }
.swap-pop .swap-h ~ .swap-h { margin-top: 10px; }
.swap-hint { margin: 12px 0 0; }

/* /substitutions */
.swap-search { max-width: 640px; margin: 8px 0 20px; }
.swap-sub { font-size: 1.2rem; margin-top: 8px; }
.swap-needs { margin-bottom: 8px; }
.swap-jump { margin-top: 16px; }
.swap-cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.swap-card-link { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--honey); border-radius: 14px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.swap-card-link:hover { border-color: var(--accent); color: var(--ink); }
.swap-card-title { font: 700 1.1rem/1.25 var(--serif); }
.swap-results { padding-top: 0; }
.swap-safety, .swap-allergy { max-width: 72ch; background: var(--warn-soft); border-radius: 12px; padding: 12px 16px; margin: 0 0 16px; }
.swap-allergy p { margin: 0; }
.swap-detail { list-style: none; padding: 0; margin: 18px 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.swap-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow); }
.swap-name { font-size: 1.25rem; margin-bottom: 8px; }
.swap-facts { margin: 0; display: grid; gap: 8px; }
.swap-facts dt { font: 700 .75rem var(--sans); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.swap-facts dd { margin: 0; }
.swap-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0 0; }
.swap-notes { max-width: 72ch; padding-left: 1.2em; }
.swap-notes li { margin-bottom: 6px; }
.swap-need { padding-block: 14px; }
.swap-need h2 { font-size: 1.3rem; }
.swap-list.wide { gap: 8px; max-width: 80ch; }
@media (max-width: 760px) {
  .swap-detail { grid-template-columns: 1fr; }
  .swap-pop { padding: 10px 12px; }
  .swap-btn { min-height: 36px; }
}
