/* ==============================================================================
   ClassKit Global - 3D Block Stacking Spatial Projection Studio Stylesheet
   Pure Vanilla CSS | A4 210mm x 297mm Vector Print Engine
   Supports Isometric 3D Rendering, Orthographic 3-Views & Layer Height Maps
   1-Up Wide & 2-Up Paper-Saving Layouts + Automated 2-Page Answer Keys
   ============================================================================== */

:root {
  --stack-border-thick: 2px solid #0F172A;
  --stack-border-thin: 0.8px solid #CBD5E1;
  --stack-ans-blue: #2563EB;
  --stack-ans-bg: rgba(37, 99, 235, 0.12);
  --stack-ans-green: #059669;
}

/* ------------------------------------------------------------------------------
   1. A4 Printable Sheet Specifics
   ------------------------------------------------------------------------------ */
.stack-sheet {
  width: 210mm;
  height: 297mm;
  min-height: 297mm;
  max-height: 297mm;
  box-sizing: border-box;
  padding: 10mm 14mm 8mm 14mm;
  background: #FFFFFF;
  color: #0F172A;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.1);
  margin-bottom: 24px;
}

.stack-sheet.answer-sheet {
  border-top: 4px solid #2563EB;
}



/* ------------------------------------------------------------------------------
   2. 3D Isometric Model Display
   ------------------------------------------------------------------------------ */
.isometric-display-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 130mm;
  margin: 0 auto;
  background: #FFFFFF;
  border: 1.4px solid #CBD5E1;
  border-radius: 2.5mm;
  padding: 3mm 4mm;
  box-sizing: border-box;
}
.isometric-display-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5mm;
}
.model-title-tag {
  font-size: 8pt;
  font-weight: 900;
  color: #0F172A;
  display: flex;
  align-items: center;
  gap: 1.5mm;
}
.isometric-stage-area {
  width: 100%;
  height: 52mm;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ------------------------------------------------------------------------------
   3. Orthographic 3-View Projections (Top, Front, Side)
   ------------------------------------------------------------------------------ */
.three-views-section {
  width: 100%;
  margin-top: 2.5mm;
}
.three-views-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5mm;
}
.three-views-title {
  font-size: 8.5pt;
  font-weight: 900;
  color: #0F172A;
  display: flex;
  align-items: center;
  gap: 1.5mm;
}
.three-views-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 3.5mm;
}
.projection-view-card {
  background: #FFFFFF;
  border: 1.2px solid #94A3B8;
  border-radius: 2mm;
  padding: 2.2mm 2.5mm;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
}
.view-card-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1mm;
  font-size: 8pt;
  font-weight: 900;
  color: #1E293B;
  margin-bottom: 2mm;
}

/* Orthographic Grid Tables */
.ortho-grid-table {
  border-collapse: collapse;
  user-select: none;
  border: var(--stack-border-thick);
  background: #FFFFFF;
}
.ortho-grid-cell {
  position: relative;
  border: 1px dashed #CBD5E1;
  box-sizing: border-box;
  text-align: center;
  vertical-align: middle;
  background: #FFFFFF;
}

/* Cell Dimensions */
.layout-content-1up .ortho-grid-cell { width: 12mm; height: 12mm; }
.layout-content-2up .ortho-grid-cell { width: 8.5mm; height: 8.5mm; }

/* Answer Key Mode Shaded Cells */
.show-solutions .ortho-grid-cell.is-filled,
.stack-sheet.answer-sheet .ortho-grid-cell.is-filled {
  background: var(--stack-ans-bg) !important;
  border: 1.4px solid #0F172A !important;
}
.cell-height-number {
  font-size: 13pt;
  font-weight: 900;
  color: var(--stack-ans-blue);
  line-height: 1;
}

/* ------------------------------------------------------------------------------
   4. Layer & Total Block Count Summary
   ------------------------------------------------------------------------------ */
.stack-summary-section {
  width: 100%;
  margin-top: 2.5mm;
  border: 1.4px solid #0F172A;
  border-radius: 2mm;
  padding: 2.2mm 3.5mm;
  box-sizing: border-box;
  background: #FAFAFA;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.summary-item-col {
  display: flex;
  align-items: center;
  gap: 2.5mm;
  font-size: 8.5pt;
  font-weight: 800;
  color: #1E293B;
}
.blank-num-line {
  display: inline-block;
  min-width: 12mm;
  border-bottom: 1.2px solid #0F172A;
  text-align: center;
}
.show-solutions .blank-num-line,
.stack-sheet.answer-sheet .blank-num-line {
  border-bottom: none;
  color: var(--stack-ans-blue);
  font-size: 11pt;
  font-weight: 900;
}

/* ------------------------------------------------------------------------------
   5. Layouts (1-Up vs 2-Up)
   ------------------------------------------------------------------------------ */
.layout-content-1up {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.layout-content-2up {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.puzzle-unit-2up {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 125mm;
}
.puzzle-unit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.2mm;
  border-bottom: 1.2px solid #0F172A;
  margin-bottom: 1.5mm;
}
.puzzle-unit-title { font-size: 10pt; font-weight: 800; color: #0F172A; }
.puzzle-unit-meta { font-size: 7.2pt; color: #64748B; font-weight: 600; }
.puzzle-unit-body-2up {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 3.5mm;
  align-items: center;
}
.puzzle-unit-2up .isometric-stage-area { height: 38mm; }

.cut-line-horizontal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2mm;
  color: #94A3B8;
  font-size: 7.5pt;
  font-weight: 700;
  margin: 2mm 0;
  user-select: none;
}
.cut-line-horizontal::before, .cut-line-horizontal::after {
  content: '';
  flex: 1;
  border-bottom: 1px dashed #CBD5E1;
}

.sheet-footer-block {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #CBD5E1;
  padding-top: 2.2mm;
  margin-top: 2.5mm;
  font-size: 7.5pt;
  color: #64748B;
  font-weight: 500;
}
.footer-brand-tag { font-weight: 700; color: #0F172A; }

/* Print Overrides */
@media print {
  .stack-sheet {
    width: 210mm !important;
    height: 297mm !important;
    min-height: 297mm !important;
    max-height: 297mm !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    box-shadow: none !important;
    page-break-inside: avoid !important;
  }
  .stack-sheet.answer-sheet {
    page-break-before: always !important;
  }
}
