/**
 * Print Profile: Sudoku / Solver
 * V7.2 Multi-Site Platform
 *
 * Solver-type puzzle print layout.
 * Applies to: sudoku, kakuro, mathdoku, kenken, nonogram.
 * 9x9 or NxN grid with box groupings.
 * Optimized for US Letter paper with larger, more readable cells.
 */

/* Solver grid container */
.solver-print-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 0 auto;
  max-width: 150mm; /* Increased from 130mm for letter paper */
}

/* Main puzzle grid */
.sudoku-print-grid,
.solver-print-grid {
  border-collapse: collapse;
  margin: 0 auto 4mm;
  border: 2.5px solid #000;
}

.sudoku-print-grid td,
.solver-print-grid td {
  width: 11mm; /* Increased from 10mm for better student writing space */
  height: 11mm; /* Increased from 10mm */
  border: 0.7px solid #999; /* Thinner to save ink */
  text-align: center;
  vertical-align: middle;
  font-size: 14pt; /* Increased from 13pt for better readability */
  font-weight: 700;
  font-family: Arial, sans-serif;
  padding: 0;
  line-height: 1;
}

/* 3x3 box borders (standard sudoku) */
.sudoku-print-grid tr:nth-child(3n) td {
  border-bottom: 2px solid #000; /* Reduced from 2.5px to save ink */
}

.sudoku-print-grid td:nth-child(3n) {
  border-right: 2px solid #000; /* Reduced from 2.5px to save ink */
}

/* Given (pre-filled) cells */
.sudoku-print-grid td.given,
.solver-print-grid td.given {
  background: #f5f5f5;
  font-weight: 700;
}

/* Empty cells in worksheet mode */
.sudoku-print-grid td.empty,
.solver-print-grid td.empty {
  color: transparent;
}

/* Pencil marks / candidates (small numbers) */
.solver-print-grid td .candidates {
  font-size: 6pt;
  font-weight: 400;
  color: #666;
  line-height: 1.1;
}

/* Answer key: filled cells */
.answer-key-grid td {
  font-weight: 700;
  color: #000;
}

.answer-key-grid .problem-answer-filled {
  display: inline-block;
  min-width: 6mm;
  font-size: 13pt;
  font-weight: 700;
}

/* Kakuro: constraint cells (dark with diagonal) */
.solver-print-grid td.constraint {
  background: #222;
  color: #fff;
  font-size: 7pt;
  font-weight: 600;
  position: relative;
}

.solver-print-grid td.constraint .down-clue,
.solver-print-grid td.constraint .across-clue {
  position: absolute;
  font-size: 7pt;
}

.solver-print-grid td.constraint .down-clue {
  bottom: 1mm;
  right: 1mm;
}

.solver-print-grid td.constraint .across-clue {
  top: 1mm;
  left: 1mm;
}

/* Nonogram: row/column clues */
.nonogram-clues-row,
.nonogram-clues-col {
  font-size: 8pt;
  font-weight: 600;
  text-align: center;
}

/* Difficulty badge */
.difficulty-badge-print {
  text-align: center;
  font-size: 9pt;
  font-weight: 600;
  color: #555;
  margin-bottom: 2mm;
  padding: 1mm 3mm;
  border: 0.8px solid #ccc;
  border-radius: 999px;
  display: inline-block;
}

@media print {
  .solver-print-container {
    page-break-inside: avoid;
  }

  .sudoku-print-grid,
  .solver-print-grid {
    page-break-inside: avoid;
  }
}
