/* PlanMySeats puzzle maker (word search and crossword): the sheet on one side, the
   words on the other. Loaded after app.css (colours, buttons, fields, reading page). */

@font-face {
  font-family: "Cormorant";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/assets/fonts/cormorant-garamond.woff2") format("woff2");
}

.doc.pz-doc { max-width: 1060px; }
.pz-doc > p, .pz-doc > ul, .pz-doc > ol, .pz-doc > h2, .pz-doc > h3 { max-width: 740px; }

.pz-tool {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 26px;
  align-items: start;
  margin: 24px 0 14px;
}
.pz-view { min-width: 0; }

/* the printed page, as it will come out */
.pz-sheet {
  padding: 26px 26px 22px;
  border: 1.5px solid var(--edge);
  border-radius: 16px;
  box-shadow: 5px 5px 0 var(--shade);
  background: #fff;
  color: #1c2622;
}
.pz-key { display: none; margin-top: 18px; }
.pz-showkey .pz-key { display: block; }
.pz-h { margin: 0 0 4px; text-align: center; font: 500 34px/1.1 "Cormorant", Georgia, serif; }
.pz-s { margin: 0 0 14px; text-align: center; font: italic 400 19px/1.3 "Cormorant", Georgia, serif; color: #4a544f; }
.pz-grid svg { display: block; width: 100%; height: auto; margin: 0 auto; }
.pz-grid .pz-frame { fill: none; stroke: #1c2622; stroke-width: 2; }
.pz-grid .pz-l {
  font: 600 21px/1 "Bricolage", sans-serif;
  fill: #1c2622;
  text-anchor: middle;
  dominant-baseline: central;
}
.pz-grid .pz-mark { stroke: #b5543b; stroke-opacity: .32; stroke-width: 30; stroke-linecap: round; }
.pz-grid .pz-cell { fill: #fff; stroke: #1c2622; stroke-width: 1.6; }
.pz-grid .pz-n { font: 600 11px/1 "Bricolage", sans-serif; fill: #1c2622; dominant-baseline: hanging; }

.pz-words {
  columns: 3 9em;
  column-gap: 20px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  font: 500 16px/1.6 "Bricolage", sans-serif;
  text-align: center;
}

/* crossword: the grid above the clues, or beside them when the grid is tall */
.pz-cw .pz-grid svg { max-height: 520px; width: auto; max-width: 100%; }
.pz-cw.tall { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 18px; align-items: start; }
/* Across in one column and Down in the other, each heading with its clues */
.pz-clues { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 22px; margin-top: 14px; font: 400 14px/1.45 "Bricolage", sans-serif; }
.pz-cw.tall .pz-clues { grid-template-columns: minmax(0, 1fr); margin-top: 0; }
.pz-clues .pz-ch { margin: 0 0 4px; font: 700 13px/1.2 "Bricolage", sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.pz-clues ul { margin: 0 0 12px; padding: 0; list-style: none; }
.pz-clues li { margin: 0 0 4px; break-inside: avoid; }
.pz-clues li b { display: inline-block; min-width: 1.6em; }
.pz-clues li span { color: #6b736f; white-space: nowrap; }

.pz-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.pz-note { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); font-size: 14px; line-height: 1.45; }
.pz-small { margin: 10px 0 0; font-size: 13px; line-height: 1.45; color: var(--muted); }

.pz-controls { min-width: 0; }
.pz-controls fieldset { min-width: 0; margin: 0 0 17px; padding: 0; border: 0; }
.pz-controls legend, .pz-controls .lbl {
  display: block;
  margin: 0 0 7px;
  padding: 0;
  font: 700 13px/1.2 var(--sans);
  letter-spacing: .02em;
}
.pz-controls .field { margin: 0 0 17px; }
.pz-controls input[type="text"], .pz-controls select { width: 100%; }
.pz-controls textarea { width: 100%; min-height: 300px; font: 15px/1.5 var(--sans); }
.pz-controls .help { margin: 6px 0 0; font-size: 13px; line-height: 1.4; color: var(--muted); }
.pz-check { display: flex; gap: 8px; align-items: center; font-size: 15px; }

.pz-opts { display: flex; flex-wrap: wrap; gap: 7px; }
.pz-opts label { position: relative; display: inline-flex; }
.pz-opts input[type="radio"] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.pz-opts span {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 6px 12px;
  border: 1.5px solid var(--edge);
  border-radius: 10px;
  background: var(--card);
  font: 600 14px/1.1 var(--sans);
}
.pz-opts label:hover span { background: var(--accent-soft); }
.pz-opts input:checked + span { background: var(--ink); color: var(--paper); }
.pz-opts input:focus-visible + span { outline: 3px solid var(--accent); outline-offset: 2px; }

@media (max-width: 760px) {
  .pz-tool { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .pz-sheet { padding: 16px 12px; }
  .pz-h { font-size: 27px; }
  .pz-grid .pz-l { font-size: 20px; }
  .pz-words { columns: 2; font-size: 15px; }
  .pz-cw.tall { display: block; }
  .pz-cw.tall .pz-clues { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin-top: 14px; }
}

/* printing gives the puzzle alone, and the answers on a second page if asked */
@media print {
  @page { size: auto; margin: 12mm; }
  .pz-doc > *:not(.pz-tool), .pz-controls, .pz-actions, .pz-note, .pz-small { display: none !important; }
  .doc.pz-doc { max-width: none; margin: 0; padding: 0; }
  .pz-tool { display: block; margin: 0; }
  .pz-sheet { padding: 0; border: 0; border-radius: 0; box-shadow: none; }
  .pz-key, .pz-showkey .pz-key { display: none; }
  .pz-withkey .pz-key { display: block; break-before: page; margin-top: 0; }
  .pz-grid svg { max-height: 165mm; width: auto; max-width: 100%; }
  .pz-cw .pz-grid svg { max-height: 150mm; }
  .pz-h { font-size: 30pt; }
  .pz-s { font-size: 15pt; }
  .pz-words { font-size: 13pt; }
  .pz-clues { font-size: 11pt; }
}
