/* The makers: a form, a line that says what happened, a preview, and a button for the PDF. */

.maker { padding: 1.25rem var(--gutter) 0.5rem; }
.crumb a { display: inline-flex; align-items: center; gap: 0.25rem; min-height: 2.75rem; color: var(--stone); font: 600 0.9375rem/1 var(--sans); text-decoration: none; }
.crumb .ic { width: 1.125rem; height: 1.125rem; }
/* one long word ("Crossword") in very large text on a narrow phone: the heading stops growing at the width of the screen */
.maker h1 { font: 500 2.125rem/1.08 var(--serif); font-size: min(2.125rem, 12vw); letter-spacing: -0.018em; margin: 0.25rem 0 0.625rem; overflow-wrap: anywhere; }
.maker .lead { max-width: 38rem; margin: 0 0 0.75rem; }
.private { display: flex; align-items: flex-start; gap: 0.5rem; max-width: 38rem; margin: 0 0 1.25rem; color: var(--stone); font-size: 0.9375rem; line-height: 1.4; }
.private .ic { flex: none; width: 1.125rem; height: 1.125rem; margin-top: 0.125rem; stroke: var(--c); }

/* the form: labels above their fields, everything large enough to press */
.maker-form { display: grid; gap: 1rem; max-width: 38rem; padding: 1.125rem 0 0.25rem; border-top: 1px solid var(--hair); }
.field { display: grid; gap: 0.3125rem; min-width: 0; }
.field > label, .field legend { font: 600 1.0625rem/1.3 var(--sans); }
.field .hint { margin: 0; color: var(--stone); font-size: 0.9375rem; line-height: 1.4; }
.field .eg { color: var(--ink); font-weight: 600; }   /* an example; it may wrap, or large text would push the page wide */
.field input[type="text"], .field input[type="search"], .field select, .field textarea {
  width: 100%; min-height: 2.875rem; padding: 0.5rem 0.75rem; border: 1px solid var(--stone); border-radius: 6px;
  background: var(--sheet); color: var(--ink); font: 400 1.0625rem/1.4 var(--sans);
}
.field textarea { min-height: 11rem; resize: vertical; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible { outline: 3px solid var(--ink); outline-offset: 1px; }
.field-row { display: grid; gap: 1rem; }
@media (min-width: 30rem) { .field-row { grid-template-columns: 1fr 1fr; } }

/* a tick box and its label, pressed anywhere along the line */
.field.check { grid-template-columns: auto 1fr; align-items: center; gap: 0.75rem; min-height: 2.75rem; }
.field.check input { width: 1.5rem; height: 1.5rem; margin: 0; accent-color: var(--ink); }
/* a long unbroken word in a label (the site's address) may break rather than push the page wide */
.field.check label { min-width: 0; overflow-wrap: anywhere; font-weight: 400; cursor: pointer; padding: 0.625rem 0; }

.maker-actions { display: flex; flex-wrap: wrap; gap: 0.625rem; padding-top: 0.25rem; }
.maker-actions .btn { flex: 1 1 12rem; }

/* the pack maker: a number and its button side by side; the themes in a box of their own that scrolls */
.pick-row { display: flex; flex-wrap: wrap; gap: 0.625rem; }
.pick-row select { flex: 0 1 6rem; width: auto; }
.pick-row .btn { flex: 1 1 10rem; }
.themes { max-height: 19rem; overflow-y: auto; border: 1px solid var(--stone); border-radius: 6px; background: var(--sheet); padding: 0.25rem 0; }
.themes:empty { display: none; }
.themes:focus-within { outline: 1px solid var(--ink); }
.themes .theme { display: flex; align-items: center; gap: 0.75rem; min-height: 2.75rem; padding: 0.25rem 0.75rem; cursor: pointer; }
.themes .theme[hidden] { display: none; }
.themes .theme + .theme { border-top: 1px solid var(--hair); }
.themes .theme input { flex: none; width: 1.5rem; height: 1.5rem; margin: 0; accent-color: var(--ink); }
.themes .theme span { min-width: 0; overflow-wrap: anywhere; }
.themes .theme:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: -3px; }
.themes .hint { padding: 0.625rem 0.75rem; }
#clear { justify-self: start; }
#clear[hidden] { display: none; }
.themes + .hint { margin-top: 0.25rem; }

/* what happened: one line, and under it any words left out with their reasons */
.maker-note { max-width: 38rem; min-height: 1.5rem; margin: 1rem 0 0; font-weight: 600; }
.maker-note.error { color: #A3261D; }
.maker-note.stale { color: var(--stone); font-weight: 400; }
.maker-refused { max-width: 38rem; margin: 0.375rem 0 0; padding: 0; list-style: none; }
.maker-refused:empty { display: none; }
.maker-refused li { padding: 0.375rem 0 0.375rem 0.75rem; border-left: 3px solid var(--rule); margin-bottom: 0.25rem; color: var(--stone); }
.maker-refused b { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }

/* the preview: the puzzle as it will print, on a sheet of its own */
.maker-preview { margin: 1.25rem 0 0.5rem; padding: 1rem; border: 1px solid var(--rule); border-radius: 4px; background: var(--sheet); container-type: inline-size; }
.maker-preview.stale { opacity: 0.55; }
.maker-preview h2 { font: 500 1.5rem/1.15 var(--serif); margin: 0 0 0.75rem; overflow-wrap: anywhere; }
.pv-grid { display: grid; grid-template-columns: repeat(var(--n), 1fr); width: min(100%, 30rem); margin: 0 auto; border: 1.5px solid var(--ink); }
.pv-grid span { display: grid; place-items: center; aspect-ratio: 1; font: 600 clamp(9px, calc(52cqw / var(--n)), 1.25rem)/1 var(--sans); }
.pv-words { margin: 1rem 0 0; padding: 0; list-style: none; columns: 3 7rem; column-gap: 1rem; font: 600 0.9375rem/1.5 var(--sans); text-transform: uppercase; }
.pv-words li { break-inside: avoid; overflow-wrap: anywhere; }

/* the pack maker's preview: under the first puzzle, the titles of them all */
.pv-also { margin: 1.25rem 0 0.375rem; padding-top: 0.875rem; border-top: 1px solid var(--rule); font: 600 1.0625rem/1.3 var(--sans); }
.pv-titles { margin: 0; padding-left: 1.75rem; columns: 2 12rem; column-gap: 1.5rem; }
.pv-titles li { break-inside: avoid; padding: 0.125rem 0; overflow-wrap: anywhere; }

/* the crossword maker's preview: the numbered grid, then the two lists of clues */
.pv-cross { display: grid; grid-template-columns: repeat(var(--cols), 1fr); width: min(100%, calc(var(--cols) * 2rem)); margin: 0 auto; padding: 0 1px 1px 0; }
.pv-cross span { aspect-ratio: 1; min-width: 0; margin: 0 -1px -1px 0; padding: 1px 0 0 2px; border: 1px solid var(--ink); overflow: hidden; font: 600 clamp(6px, calc(34cqw / var(--cols)), 0.6875rem)/1 var(--sans); }
.pv-cross .gap { visibility: hidden; }
.pv-clues { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 14rem), 1fr)); gap: 0.75rem 1.5rem; margin-top: 1.125rem; }
.pv-clues h3 { margin: 0 0 0.375rem; padding-bottom: 0.25rem; border-bottom: 1px solid var(--rule); font: 600 1.0625rem/1.3 var(--sans); }
.pv-clues ul { margin: 0; padding: 0; list-style: none; }
.pv-clues li { padding: 0.1875rem 0 0.1875rem 2rem; text-indent: -2rem; overflow-wrap: anywhere; }
.pv-clues b { display: inline-block; min-width: 2rem; text-indent: 0; font-weight: 600; }

/* the Fourfold maker: each group under a rule of its own, its link and its four words; then the
   link it makes, in a box that can be selected and copied, and the buttons that send it on */
.maker-form .group { margin: 0; padding: 0.875rem 0 0; border: 0; border-top: 1px solid var(--hair); gap: 0.75rem; }
.maker-form .group legend { padding: 0; margin-bottom: 0.5rem; }
.link-out .field { margin-bottom: 0.75rem; }
.link-out input[readonly] { font-size: 0.9375rem; color: var(--ink); }
.link-out .maker-actions .btn { flex: 1 1 8rem; }

.maker .howto { padding-left: 0; padding-right: 0; }

/* the bingo maker: a theme's introduction, the first card of the set, a sample card as it prints,
   a theme's songs and sources, and the list of themes */
.maker .intro { max-width: 38rem; }
.maker .intro p { margin: 0 0 0.75rem; }
.pv-bingo { display: grid; grid-template-columns: repeat(var(--n), 1fr); width: min(100%, 32rem); margin: 0 auto; border: 2px solid var(--ink); }
/* small enough that a word of ten letters keeps to its square on a phone; a longer one breaks rather than be cut */
.pv-bingo span { display: grid; place-items: center; aspect-ratio: 1; min-width: 0; padding: 0.1875rem; border: 1px solid var(--rule); overflow: hidden; overflow-wrap: anywhere; hyphens: auto; text-align: center; font: 600 clamp(8px, calc(17cqw / var(--n)), 1.0625rem)/1.15 var(--sans); }
.pv-bingo .free { background: #ECE8DF; }
.bingo .sample { margin: 1.5rem 0 0.5rem; }
.bingo .sample img { display: block; width: min(100%, 26rem); height: auto; border: 1px solid var(--rule); background: #FFFFFF; }
.bingo .sample figcaption { max-width: 26rem; margin-top: 0.5rem; color: var(--stone); font-size: 0.9375rem; line-height: 1.4; }
.bingo .songs { padding-left: 0; padding-right: 0; }
.bingo .songs h3 { margin: 1rem 0 0.25rem; font: 600 1.0625rem/1.3 var(--sans); }
.bingo .songs ul { margin: 0; padding-left: 1.25rem; }
.bingo .sources { max-width: 38rem; margin: 1.5rem 0 0; }
.bingo .sources p { color: var(--stone); font-size: 0.9375rem; margin: 0 0 0.375rem; }
.bingo .sources ul { margin: 0; padding-left: 1.25rem; }
.bingo .sources a { display: inline-block; padding: 0.6875rem 0; overflow-wrap: anywhere; }   /* 44px tall to press */
.bingo .more-in { margin: 1.75rem 0 0; }
.bingo .more-in h2 { font: 500 1.375rem/1.15 var(--serif); margin: 0 0 0.25rem; }
.bingo .more-in p { color: var(--stone); font-size: 0.9375rem; margin: 0; }
.bingo-themes { margin: 0.5rem 0 0; padding: 0; list-style: none; columns: 2 14rem; column-gap: 1.5rem; }
.bingo-themes li { break-inside: avoid; }
.bingo-themes a { display: flex; align-items: center; min-height: 2.75rem; font-weight: 600; overflow-wrap: anywhere; }

@media (forced-colors: active) {
  .maker-refused li { border-left-color: CanvasText; }
  .maker-preview { border-color: CanvasText; }
  .pv-cross span { border-color: CanvasText; }
}
