/* Library card catalog: typewritten index cards on cream stock, black ink, a red rule.
   Typewriter (Courier Prime) for catalog details; book serif (Libre Caslon) for reading. */

@font-face { font-family: "Courier Prime"; font-style: normal; font-weight: 400; font-display: swap;
             src: url(fonts/courier-prime-400.woff2) format("woff2"); }
@font-face { font-family: "Courier Prime"; font-style: normal; font-weight: 700; font-display: swap;
             src: url(fonts/courier-prime-700.woff2) format("woff2"); }
@font-face { font-family: "Libre Caslon Text"; font-style: normal; font-weight: 400; font-display: swap;
             src: url(fonts/libre-caslon-400.woff2) format("woff2"); }
@font-face { font-family: "Libre Caslon Text"; font-style: italic; font-weight: 400; font-display: swap;
             src: url(fonts/libre-caslon-400-italic.woff2) format("woff2"); }
@font-face { font-family: "Libre Caslon Text"; font-style: normal; font-weight: 700; font-display: swap;
             src: url(fonts/libre-caslon-700.woff2) format("woff2"); }

:root {
  --type: "Courier Prime", "Courier New", Courier, monospace;
  --book: "Libre Caslon Text", Georgia, "Times New Roman", serif;
  --bg: #e8e8e5;      /* steel card-drawer grey */
  --paper: #fbf9f2;   /* cream index card */
  --fg: #1e1e1e;      /* typewriter ink */
  --muted: #676661;
  --line: #cfcec8;
  --rule: #b8352b;    /* catalog-card red line */
  --done: #a3a29c;
  font-size: 18px;
}
@media (prefers-color-scheme: dark) {
  :root {  /* charcoal with cream ink */
    --bg: #18191a; --paper: #232425; --fg: #eee8d9; --muted: #9e9c95;
    --line: #3b3c3e; --rule: #d05a4f; --done: #66655f;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 1rem/1.55 var(--book); }
main { max-width: 1100px; margin: 0 auto; padding: 0 16px 48px; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.muted { color: var(--muted); }
h1, h2, h3 { font-family: var(--type); font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: .85rem; text-transform: uppercase; letter-spacing: .12em;
     padding-bottom: 4px; border-bottom: 1px solid var(--rule); margin: 24px 0 8px; }

/* Header */
.site { padding: 14px 16px 10px; border-bottom: 2px solid var(--rule); background: var(--paper); }
.brand { font-family: var(--type); font-weight: 700; font-size: 1rem; text-decoration: none;
         text-transform: uppercase; letter-spacing: .12em; }

/* Search */
#search { position: sticky; top: 0; background: var(--bg); padding: 14px 0 10px; z-index: 1; }
#q, .family-search input, .error input {
  width: 100%; font: 1.05rem var(--type); padding: 11px 12px; border: 1px solid var(--fg);
  border-radius: 0; background: var(--paper); color: var(--fg); }
.login input, .login button { margin-bottom: 10px; }
.filters { margin-top: 8px; }
.filters summary { cursor: pointer; color: var(--muted); padding: 6px 0; font-family: var(--type);
                   font-size: .9rem; }
fieldset { border: 0; padding: 0; margin: 10px 0; }
legend { font: .75rem var(--type); color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }
.chip { display: inline-block; margin: 4px 4px 0 0; }
.chip input { position: absolute; opacity: 0; }
.chip span, .chip-link {
  display: inline-block; padding: 4px 10px; border: 1px solid var(--line); border-radius: 0;
  background: var(--paper); color: var(--fg); font: .85rem var(--type); cursor: pointer;
  text-decoration: none; }
.chip input:checked + span, .chip-link[aria-current="page"] {
  background: var(--fg); color: var(--paper); border-color: var(--fg); }
.chip input:focus-visible + span { outline: 2px solid var(--rule); }
.chip-link[aria-current="page"] .muted { color: inherit; opacity: .75; }
.selects { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
.selects label { display: flex; flex-direction: column; font: .75rem var(--type); color: var(--muted);
                 text-transform: uppercase; letter-spacing: .12em; }
.selects select { font: 1rem var(--type); padding: 6px; max-width: 100%; border-radius: 0;
                  border: 1px solid var(--line); background: var(--paper); color: var(--fg); }

/* Result lists: catalog entries */
.count { color: var(--muted); font: .85rem var(--type); margin: 10px 0 4px;
         text-transform: uppercase; letter-spacing: .1em; }
.cards { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.card { display: flex; gap: 12px; align-items: center; padding: 10px 0;
        border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; }
.card img { width: 56px; height: 56px; object-fit: cover; flex: none; filter: saturate(.85); }
.card-text { display: flex; flex-direction: column; min-width: 0; }
.card-title { font-family: var(--type); font-weight: 700; line-height: 1.3; }
.card-meta { color: var(--muted); font: .82rem var(--type); }

/* Bean families: index cards in a drawer */
.families { list-style: none; padding: 0; margin: 8px 0 0;
            /* 165px keeps every family name to two lines and still fits two cards on a phone */
            display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
            grid-auto-rows: 1fr; gap: 10px; }  /* every card the same height */
.families li { display: flex; }
.family { position: relative; flex: 1; display: flex; flex-direction: column; justify-content: flex-start;
          gap: 8px; padding: 12px 12px 26px; background: var(--paper);
          border: 1px solid var(--line); color: var(--fg); text-decoration: none;
          box-shadow: 0 1px 0 var(--line); }
.family::after { /* the rod hole at the bottom of a catalog card */
  content: ""; position: absolute; left: 50%; bottom: 7px; width: 9px; height: 9px;
  margin-left: -4.5px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg); }
.family:hover, .family:focus-visible { border-color: var(--fg); }
.family-name { font-family: var(--type); font-weight: 700; line-height: 1.25;
               /* room for two lines (+ padding and rule), so rules and counts line up */
               min-height: calc(2.5em + 7px);
               padding-bottom: 6px; border-bottom: 1px solid var(--rule); }
.family-count { color: var(--muted); font: .85rem var(--type); }
.star { color: var(--rule); }
.soundtrack { margin-top: 28px; max-width: 480px; }
.soundtrack iframe { display: block; border: 0; }
.faves-note { margin: 0 0 8px; font-style: italic; }
.all-link { margin: 22px 0 8px; font-family: var(--type); font-size: .9rem; }
.last-cooked { margin: 0 0 20px; color: var(--muted); font-style: italic; font-size: .95rem; }
.family-search input { margin-top: 14px; font-size: 1rem; }
.crumb { margin: 14px 0 0; font: .85rem var(--type); }
.variety-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 4px; }

/* How to cook beans */
.guide-section h2 { margin-top: 28px; }
.bean-times { width: 100%; border-collapse: collapse; margin-top: 12px; font-family: var(--type);
              font-size: .92rem; font-variant-numeric: tabular-nums; }
.bean-times th { text-align: left; font-size: .72rem; font-weight: 700; color: var(--muted);
                 text-transform: uppercase; letter-spacing: .12em;
                 padding: 0 12px 6px 0; border-bottom: 1px solid var(--rule); }
.bean-times td { text-align: left; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line);
                 vertical-align: top; }
.bean-times td:first-child { font-weight: 700; }
.bean-times td + td, .bean-times th + th { white-space: nowrap; width: 1%; }
.bean-times td:last-child, .bean-times th:last-child { padding-right: 0; }

/* Recipe: one cream catalog card */
.recipe { margin-top: 14px; padding: 4px 14px 20px; background: var(--paper);
          border: 1px solid var(--line); box-shadow: 0 1px 0 var(--line); }
@media (min-width: 700px) { .recipe { padding: 8px 28px 28px; } }
.hero { width: 100%; max-height: 50vh; object-fit: cover; margin-top: 10px; filter: saturate(.9); }
.recipe h1 { font-size: 1.5rem; line-height: 1.2; margin: 18px 0 6px; }
.source, .times { color: var(--muted); margin: 4px 0; font: .88rem/1.4 var(--type); }
.times span + span::before { content: " · "; }
.tools { display: flex; gap: 8px; margin: 14px 0; }
button, .step-btn { font: .88rem var(--type); padding: 7px 12px; border-radius: 0;
         border: 1px solid var(--fg); background: transparent; color: var(--fg); cursor: pointer;
         text-decoration: none; }
button[aria-pressed="true"], .tabs [aria-selected="true"] { background: var(--fg); color: var(--paper); }
.scaler { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; font-family: var(--type); }
.step-btn[aria-disabled="true"] { opacity: .35; pointer-events: none; }
.ing-list { list-style: none; padding: 0; margin: 0; }
.ing-list li, .step { padding: 8px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.step-list { list-style: none; padding: 0; margin: 0; counter-reset: step; }
.step::before { counter-increment: step; content: counter(step) ". "; font-family: var(--type);
                font-weight: 700; }
.step-heading { font-family: var(--type); font-weight: 700; margin-top: 16px; list-style: none; }
.done { color: var(--done); text-decoration: line-through; }
.notes { margin-top: 24px; padding: 4px 16px 12px; background: var(--bg);
         border: 1px solid var(--line); }
.beans { margin-top: 24px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
@media (min-width: 900px) {
  .columns { display: grid; grid-template-columns: minmax(280px, 2fr) 3fr; gap: 32px; }
}

/* Print */
@media print {
  :root { font-size: 11.5pt; --fg: #000; --bg: #fff; --paper: #fff; --muted: #333; --line: #ccc; }
  .no-print, .hero, .tools, .scaler a, .beans { display: none !important; }
  main { max-width: none; padding: 0; }
  .recipe { border: 0; box-shadow: none; padding: 0; margin: 0; }
  .columns { display: grid; grid-template-columns: 2fr 3fr; gap: 24px; }
  .done { color: inherit; text-decoration: none; }
  .ing-list li, .step { padding: 2px 0; border: 0; }
  .notes { break-inside: avoid; }
}
