/* Printable planning templates (/tools/printable-wedding-planning-templates/).

   Loaded after style.css and tools.css on that page only. Each template is a
   .sheet sized in millimetres and points, so the on-screen preview is the
   printed page: on screen it sits on a sheet of "paper" scaled to fit (see
   printables.js); in print the paper frame goes and the sheet fills the A4
   page. Row heights are tuned so each sheet fits one page; the blank-row
   counts live in _data/printables.js. */

/* Page furniture (screen only) */

.printables-intro > p {
  max-width: var(--content-width);
}

.printables-contents {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
}

.printables-contents a {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--color-border-strong);
  border-radius: 999px;
  color: var(--color-text);
  font-size: 0.9375rem;
  font-weight: 600;
  text-decoration: none;
}

.printables-contents a:hover {
  border-color: var(--color-accent);
  color: var(--color-accent-dark);
}

.printables-toolbar {
  gap: 0.75rem 1.25rem;
}

.printables-tip {
  flex: 1 1 18rem;
  margin: 0;
  font-size: 0.875rem;
  color: var(--color-text-muted);
}

.printable {
  display: grid;
  gap: 1.25rem;
  margin-top: 2.25rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-border);
}

@media (min-width: 52rem) {
  .printable {
    grid-template-columns: minmax(0, 17rem) minmax(0, 1fr);
    align-items: start;
    gap: 2rem;
  }
}

.printable-info h2 {
  margin: 0 0 0.6rem;
  font-size: 1.375rem;
}

.printable-info p {
  font-size: 0.9375rem;
}

.printable-pages {
  font-size: 0.8125rem !important;
  font-weight: bold;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-accent-2-badge);
}

.printable-actions {
  display: grid;
  justify-items: start;
  gap: 0.9rem;
}

.printable-online {
  margin: 0;
  color: var(--color-text-muted);
}

/* The preview: a sheet of paper on a tinted desk. printables.js sets
   --sheet-zoom so the whole width fits; without it, the desk scrolls. */

.sheet-preview {
  --sheet-zoom: 0.7;
  overflow: auto;
  padding: clamp(0.5rem, 2vw, 1.25rem);
  border-radius: var(--radius-lg);
  background: var(--color-bg-alt);
}

.sheet-preview-long {
  max-height: min(48rem, 85vh);
}

.sheet-preview .sheet {
  zoom: var(--sheet-zoom);
  width: 210mm;
  min-height: 297mm;
  margin: 0 auto;
  padding: 12mm 14mm;
  background: #fff;
  box-shadow: 0 1px 3px rgba(54, 42, 40, 0.18), 0 6px 20px rgba(54, 42, 40, 0.1);
}

.sheet-preview-long .sheet {
  min-height: 0;
}

/* The sheets themselves: black on white, thin lines, 9 to 11pt type. */

.sheet {
  display: flex;
  flex-direction: column;
  color: #000;
  font-family: var(--font-sans);
  font-size: 10.5pt;
  line-height: 1.3;
}

.sheet > * {
  flex-shrink: 0;
}

.sheet-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 3mm 8mm;
  margin-bottom: 5mm;
  padding-bottom: 3mm;
  border-bottom: 1pt solid #000;
}

.sheet .sheet-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 19pt;
  font-weight: 600;
  line-height: 1.1;
  color: #000;
}

.sheet-fields {
  display: flex;
  flex: 1 1 90mm;
  gap: 6mm;
  max-width: 110mm;
}

.sheet-fields .sheet-fill {
  flex: 1 1 0;
}

.sheet-fields .sheet-fill-pages {
  flex: 0 0 30mm;
}

.sheet-fields-stack {
  flex: none;
  flex-direction: column;
  gap: 5mm;
  max-width: none;
  margin-top: 6mm;
}

.sheet-fill {
  display: flex;
  align-items: flex-end;
  gap: 2mm;
  font-size: 9.5pt;
}

.sheet-fill-label {
  white-space: nowrap;
}

.sheet-fill-line {
  flex: 1 1 auto;
  min-width: 12mm;
  height: 1.2em;
  border-bottom: 0.6pt solid #000;
}

.sheet-box {
  display: inline-block;
  flex-shrink: 0;
  width: 3.6mm;
  height: 3.6mm;
  border: 0.75pt solid #000;
  border-radius: 0.5mm;
  vertical-align: middle;
}

.sheet-hint {
  display: block;
  font-size: 8pt;
  font-weight: normal;
  line-height: 1.2;
}

.sheet-key {
  margin: 3mm 0 0;
  font-size: 8.5pt;
}

.sheet-foot {
  margin: auto 0 0;
  padding-top: 4mm;
  font-size: 7.5pt;
  text-align: right;
}

/* Tables */

.sheet-table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 9.5pt;
  line-height: 1.25;
}

.sheet-table th,
.sheet-table td {
  height: 7.6mm;
  padding: 0.8mm 1.6mm;
  border: 0.5pt solid #000;
  text-align: left;
  vertical-align: middle;
  color: #000;
}

.sheet-table thead th {
  height: auto;
  padding-top: 1.4mm;
  padding-bottom: 1.4mm;
  border-bottom-width: 1pt;
  font-size: 9pt;
  font-weight: bold;
  vertical-align: bottom;
}

.sheet-table tbody th {
  font-weight: normal;
}

.sheet-table tfoot th,
.sheet-table tfoot td {
  border-top-width: 1pt;
  font-weight: bold;
}

.sheet-choice {
  text-align: center !important;
  font-size: 8.5pt;
  white-space: nowrap;
}

.sheet-score {
  text-align: right !important;
  font-size: 8.5pt;
}

/* Budget */

.sheet-budget .col-category {
  width: 40%;
}

.sheet-budget tbody th,
.sheet-budget tbody td {
  height: 8.2mm;
}

.sheet-budget-summary {
  width: 62%;
  margin: 5mm 0 0 auto;
}

.sheet-budget-summary th {
  width: 66%;
  font-weight: bold !important;
}

.sheet-budget-summary th,
.sheet-budget-summary td {
  height: 10mm;
}

/* Guest list */

.sheet-guests .col-name { width: 27%; }
.sheet-guests .col-de { width: 11%; }
.sheet-guests .col-sent { width: 11%; }
.sheet-guests .col-rsvp { width: 12%; }
.sheet-guests .col-num { width: 9.5%; }
.sheet-guests .col-notes { width: 20%; }

.sheet-guests thead th {
  font-size: 8.5pt;
}

.sheet-guests tbody td {
  height: 8.6mm;
}

/* Checklist */

.sheet-stage {
  margin-top: 4.5mm;
}

.sheet-head + .sheet-stage {
  margin-top: 0;
}

.sheet .sheet-stage-title,
.sheet .sheet-subtitle {
  margin: 0 0 1.5mm;
  padding-bottom: 1mm;
  border-bottom: 0.6pt solid #000;
  font-family: var(--font-serif);
  font-size: 12.5pt;
  font-weight: 600;
  line-height: 1.2;
  color: #000;
  break-after: avoid;
}

.sheet-tasks {
  margin: 0;
  padding: 0;
  list-style: none;
}

.sheet-tasks li {
  display: flex;
  align-items: flex-start;
  gap: 2.6mm;
  margin: 0;
  padding: 0.9mm 0;
  break-inside: avoid;
}

.sheet-tasks .sheet-box {
  margin-top: 0.3mm;
}

.sheet-task-note {
  display: block;
  margin-top: 0.4mm;
  font-size: 8.5pt;
  font-style: italic;
}

.sheet-task-blank .sheet-fill-line {
  height: 4.5mm;
}

/* Schedule */

.sheet-schedule .col-time { width: 14%; }
.sheet-schedule .col-what { width: 44%; }
.sheet-schedule .col-who { width: 21%; }
.sheet-schedule .col-where { width: 21%; }

.sheet-schedule tbody td {
  height: 9.4mm;
}

.sheet .sheet-subtitle {
  margin-top: 6mm;
  border-bottom: 0;
}

.sheet-contacts .col-contact { width: 36%; }
.sheet-contacts .col-role { width: 32%; }
.sheet-contacts .col-phone { width: 32%; }

.sheet-contacts tbody td {
  height: 8.6mm;
}

/* Seating plan */

.sheet-seat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5mm 6mm;
}

.sheet-seat-block {
  padding: 2.6mm 3mm 3mm;
  border: 0.5pt solid #000;
  border-radius: 1.5mm;
  break-inside: avoid;
}

.sheet-seat-head {
  margin: 0 0 2mm;
}

.sheet-seat-body {
  display: flex;
  align-items: center;
  gap: 3mm;
}

.sheet-seat-diagram {
  flex: 0 0 33mm;
  width: 33mm;
  height: 33mm;
}

.sheet-seat-diagram circle {
  fill: #fff;
  stroke: #000;
  stroke-width: 0.3;
}

.sheet-seat-diagram text {
  font-family: var(--font-sans);
  font-size: 3.3px;
  fill: #000;
  text-anchor: middle;
  dominant-baseline: central;
}

.sheet-seat-lines {
  flex: 1 1 auto;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 8.5pt;
}

.sheet-seat-lines li {
  display: flex;
  align-items: flex-end;
  gap: 1.6mm;
  height: 5.9mm;
  margin: 0;
}

.sheet-seat-no {
  flex: 0 0 4mm;
  text-align: right;
}

.sheet-seat-lines .sheet-fill-line {
  height: auto;
  align-self: stretch;
}

/* Supplier comparison */

.sheet-suppliers .col-label {
  width: 28%;
}

.sheet-suppliers tbody th,
.sheet-suppliers tbody td {
  height: 8mm;
}

.sheet-suppliers .sheet-row-tall th,
.sheet-suppliers .sheet-row-tall td {
  height: 28mm;
  vertical-align: top;
}

.sheet-scores {
  margin-top: 5mm;
}

.sheet-scores tbody td {
  height: 8.4mm;
}

/* Print: only the sheets, each on its own A4 page. The site header, footer,
   breadcrumbs, FAQ and related links are already hidden by tools.css. */

@media print {
  @page {
    size: A4 portrait;
    margin: 12mm 14mm;
  }

  .tool-header,
  .printables-intro,
  .printable-info {
    display: none !important;
  }

  html,
  body {
    background: #fff !important;
  }

  .tool-page,
  main {
    max-width: none;
    margin: 0;
    padding: 0;
  }

  .tool-app {
    background: none;
  }

  .printable {
    display: block;
    margin: 0;
    padding: 0;
    border: 0;
  }

  .printable + .printable {
    break-before: page;
  }

  /* "Print this sheet": printables.js marks the chosen sheet. */
  html[data-print-sheet] .printable:not(.is-print-target) {
    display: none !important;
  }

  html[data-print-sheet] .printable {
    break-before: auto !important;
  }

  .sheet-preview,
  .sheet-preview-long {
    overflow: visible;
    max-height: none;
    padding: 0;
    border-radius: 0;
    background: none;
  }

  .sheet-preview .sheet {
    display: block;
    zoom: 1 !important;
    width: auto;
    min-height: 0;
    padding: 0;
    box-shadow: none;
  }

  .sheet-table thead {
    display: table-header-group;
  }

  .sheet-table tr {
    break-inside: avoid;
  }

  /* Never leave the footer line alone on a page of its own. */
  .sheet-foot {
    break-before: avoid;
  }
}
