/* Kitchen conversions (task 823.18): the "≈ 125 g" hint on recipe ingredient lines, the /conversions calculator and the
   conversion pages. Colors come from site.css. Loaded on recipe pages and the conversion pages. */
.conv-hint { margin-left: .3em; font-size: .8rem; color: var(--muted); white-space: nowrap; text-decoration: underline dotted; text-underline-offset: 3px; }
.conv-hint:hover { color: var(--link); }
/* an ingredient line's name, linked to its guide (task 823.47; this file loads before the recipe's ingredient list) */
.ing-list .item a { color: inherit; text-decoration: underline; text-decoration-color: var(--field-line); text-underline-offset: 3px; }
.ing-list .item a:hover { color: var(--link); text-decoration-color: currentColor; }
@media print { .conv-hint { display: none; } }

.conv-jump { margin-top: 12px; }
.conv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.conv-tool { scroll-margin-top: 80px; }
.conv-tool.on { border-color: var(--honey); }
.conv-tool h2 { font-size: 1.25rem; margin: 0 0 2px; }
.conv-tool > .muted { margin: 0 0 12px; }
.conv-form { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.conv-fields { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; flex: 1 1 100%; }
.conv-field { display: flex; flex-direction: column; gap: 4px; }
.conv-field label { font-size: .82rem; font-weight: 600; color: var(--muted); }
.conv-field input { width: 6.5em; }
.conv-field input.conv-wide { width: 100%; min-width: 13em; }
.conv-field:has(.conv-wide) { flex: 1 1 13em; }
.conv-custom { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: 10px; align-items: end; margin: 0; padding: 8px 12px 12px; border: 1px dashed var(--line); border-radius: 10px; }
.conv-custom legend { font-size: .82rem; font-weight: 600; color: var(--muted); padding: 0 4px; }
.conv-custom .conv-field input { width: 5em; }
.js .conv-custom[data-off], .conv-custom[hidden] { display: none; }
.conv-out { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.conv-main { font: 700 1.15rem/1.35 var(--serif); margin: 0 0 8px; }
.conv-error { color: var(--bad); font-weight: 600; margin: 0 0 8px; }
.conv-rows { border-collapse: collapse; margin: 0 0 8px; font-size: .92rem; }
.conv-rows th { text-align: left; font-weight: 500; color: var(--muted); padding: 3px 16px 3px 0; }
.conv-rows td { padding: 3px 0; font-variant-numeric: tabular-nums; }
.conv-note { font-size: .86rem; color: var(--muted); margin: 0 0 6px; max-width: 70ch; }
.conv-cards { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.conv-cards a { display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-left: 5px solid var(--honey); border-radius: 14px; color: var(--ink); text-decoration: none; box-shadow: var(--shadow); }
.conv-cards a:hover { border-color: var(--accent); }

/* conversion pages */
.conv-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; margin: 0 0 20px; font-variant-numeric: tabular-nums; }
.conv-table caption { text-align: left; font: 700 1.1rem var(--serif); padding: 0 0 8px; }
.conv-table th, .conv-table td { text-align: left; padding: 7px 12px; border-bottom: 1px solid var(--line); }
.conv-table thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface-2); }
.conv-table tbody th { font-weight: 600; }
.conv-table tbody tr:last-child > * { border-bottom: 0; }
.conv-table tbody tr:nth-child(even) { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
.conv-group { padding-block: 10px; }
.conv-group h2 { font-size: 1.3rem; }
.conv-group [id] { scroll-margin-top: 80px; }
.conv-how { max-width: 78ch; margin: 8px 0 20px; }
.conv-how h2 { font-size: 1.2rem; }
.conv-how ol { margin: 0; padding-left: 1.3em; }
.conv-how li { margin-bottom: 6px; }
.conv-recipes { list-style: none; padding: 0; margin: 0 0 8px; columns: 3 220px; column-gap: 24px; }
.conv-recipes li { break-inside: avoid; padding: 3px 0; }
.conv-temps { margin: 0; display: grid; gap: 10px; }
.conv-temps dt { font-weight: 700; }
.conv-temps dd { margin: 2px 0 0; }
.conv-sources { margin: 8px 0 16px; max-width: 90ch; }
.conv-sources summary { cursor: pointer; font-weight: 600; }
.conv-sources ul { columns: 2 300px; padding-left: 1.2em; }
@media (max-width: 860px) {
  .conv-grid { grid-template-columns: 1fr; }
  .conv-table th, .conv-table td { padding: 6px 8px; }
}

/* The recipe page's Grams switch (task 823.43): a pill like the US/Metric one; on means every measured line is in grams. */
.grams-btn { border: 1.5px solid var(--field-line); border-radius: 999px; background: var(--surface); color: var(--ink); padding: 0 14px; min-height: 40px; font: 600 .9rem var(--sans); cursor: pointer; }
.grams-btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.grams-note { margin: 4px 0 8px; }
@media print { .grams-note { display: none; } }

/* One ingredient's page */
.conv-item .conv-tool { max-width: 640px; margin: 0 0 20px; }
.conv-item-tables { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; align-items: start; }
.conv-sources-box { max-width: 78ch; margin: 0 0 16px; }
.conv-sources-box h2 { font-size: 1.1rem; }
.conv-cite { max-width: 78ch; }
@media (max-width: 720px) { .conv-item-tables { grid-template-columns: 1fr; } }
/* Cook mode's Grams switch (task 823.50): on the gather step and in the ingredients drawer, next to Close. */
.cook-grams { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 0 0 12px; }
.drawer-head .grams-btn { margin: 0 10px 0 auto; }
