/* ==========================================================================
   ClassKit Global - Primary Handwriting & Story Paper Stylesheet
   ========================================================================== */

.handwriting-sheet {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  padding: 16mm 16mm 14mm;
  background: #FFFFFF;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  margin-bottom: 24px;
  position: relative;
  page-break-after: always;
  break-after: page;
}

.handwriting-alphabet-strip {
  background: #F8FAFC;
  border: 1px solid #E2E8F0;
  border-radius: 6px;
  padding: 6px 10px;
  font-family: 'Outfit', -apple-system, sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  color: #334155;
  letter-spacing: 2px;
  text-align: center;
  margin-bottom: 12px;
}

.handwriting-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  gap: 12px;
}

/* Layout: Story Paper */
.story-drawing-box {
  width: 100%;
  height: 38%;
  border: 2px dashed #CBD5E1;
  border-radius: 8px;
  background: #FAFAFA;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #94A3B8;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
}

.story-drawing-box .draw-icon {
  font-size: 24px;
  opacity: 0.6;
}

/* Layout: Split 2-Column */
.handwriting-content.layout-split {
  flex-direction: row;
  gap: 16px;
}

.handwriting-content.layout-split .story-drawing-box {
  width: 42%;
  height: 100%;
}

.handwriting-content.layout-split .handwriting-lines-container {
  width: 58%;
}

/* Handwriting Lines Container */
.handwriting-lines-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  min-height: 0;
}

/* Primary 3-Line Block */
.primary-line-row {
  width: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.primary-line-row.spacing-large {
  height: 56px;
}

.primary-line-row.spacing-medium {
  height: 42px;
}

.primary-line-row.spacing-small {
  height: 30px;
}

/* 3-Line Guide System */
.line-guide-top {
  width: 100%;
  height: 1px;
  background-color: #60A5FA; /* Solid Top Line (Blue) */
}

.line-guide-middle {
  width: 100%;
  height: 0;
  border-top: 1.5px dashed #94A3B8; /* Midline (Dashed) */
  flex: 1;
  display: flex;
  align-items: center;
}

.line-guide-base {
  width: 100%;
  height: 1.5px;
  background-color: #EF4444; /* Base Line (Solid Red) */
}

/* Descender Gap */
.line-guide-descender {
  width: 100%;
  height: 25%;
  background: transparent;
}

/* Print Overrides */
@media print {
  .handwriting-sheet {
    padding: 12mm 12mm 10mm !important;
  }

  .story-drawing-box {
    border-color: #94A3B8 !important;
    background: transparent !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .line-guide-top {
    background-color: #60A5FA !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .line-guide-middle {
    border-top-color: #94A3B8 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  .line-guide-base {
    background-color: #EF4444 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}
