/**
 * Print Stylesheet - Matches PDF Layout Exactly
 * Clear Thinking Essentials
 */

@media print {
  /* Reset and Page Setup */
  * {
    box-sizing: border-box;
  }

  @page {
    size: 8.5in 11in; /* US Letter */
    margin: 0.75in;
  }

  body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 11pt;
    line-height: 1.6;
    color: #000;
    background: white;
  }

  /* Hide screen-only elements */
  header.site-header,
  footer.site-footer,
  nav.breadcrumb,
  .lesson-nav,
  .checkpoint-nav,
  button,
  .no-print {
    display: none !important;
  }

  /* Page Breaks */
  .page-break-after {
    page-break-after: always;
    break-after: page;
  }

  .page-break-before {
    page-break-before: always;
    break-before: page;
  }

  .page-break-avoid {
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* Cover Page */
  .cover-page {
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    background: #f5f5f5;
    position: relative;
  }

  .cover-title {
    font-size: 72pt;
    font-weight: 800;
    line-height: 1.1;
    margin: 0 0 0.25in 0;
    color: #000;
  }

  .cover-subtitle {
    font-size: 32pt;
    font-weight: 400;
    margin: 0 0 1in 0;
    color: #000;
  }

  .cover-branding {
    position: absolute;
    bottom: 1in;
    font-size: 36pt;
    font-weight: 900;
    letter-spacing: 0.1em;
    color: #000;
  }

  /* Cover Shapes */
  .cover-shapes {
    width: 100%;
    max-width: 6in;
    height: 4in;
    position: relative;
    margin: 0 auto 1in;
  }

  .shape {
    position: absolute;
  }

  .shape-green-half {
    width: 2.5in;
    height: 1.5in;
    background: #059669;
    border-radius: 2.5in 2.5in 0 0;
    top: 0.5in;
    left: 0.5in;
  }

  .shape-yellow-circle {
    width: 3.5in;
    height: 3.5in;
    background: #fbbf24;
    border-radius: 50%;
    top: 0;
    right: 0;
  }

  .shape-pink-square {
    width: 2.5in;
    height: 2.5in;
    background: #ec4899;
    border-radius: 0.25in;
    bottom: 0.75in;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .shape-pink-square .inner-circle {
    width: 1.75in;
    height: 1.75in;
    background: white;
    border-radius: 50%;
  }

  .shape-blue-rect {
    width: 2.75in;
    height: 2in;
    background: #2563eb;
    border-radius: 0.25in;
    bottom: 0.75in;
    right: 0.25in;
  }

  .shape-row {
    display: flex;
    gap: 0.125in;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
  }

  .shape-green-rect {
    width: 1.5in;
    height: 0.75in;
    background: #059669;
  }

  .shape-yellow-bars {
    flex: 1;
    height: 0.75in;
    background: repeating-linear-gradient(
      to bottom,
      #fbbf24 0,
      #fbbf24 0.2in,
      white 0.2in,
      white 0.25in
    );
  }

  .shape-pink-circle {
    width: 1in;
    height: 1in;
    background: #ec4899;
    border-radius: 50%;
    margin-top: -0.125in;
  }

  /* Page Header */
  .page-header {
    text-align: center;
    margin-bottom: 0.5in;
    padding-bottom: 0.125in;
    border-bottom: 1pt solid #e5e7eb;
  }

  .header-branding {
    font-size: 7pt;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #6b7280;
    margin: 0;
  }

  /* Lesson Content */
  .lesson-content h1,
  .checkpoint-content h1 {
    font-size: 28pt;
    font-weight: 700;
    margin: 0.25in 0;
    padding-bottom: 0.125in;
    border-bottom: 3pt solid #059669;
    color: #000;
  }

  .lesson-content h2,
  .checkpoint-content h2 {
    font-size: 18pt;
    font-weight: 700;
    margin: 0.25in 0 0.125in 0;
    padding-bottom: 0.0625in;
    border-bottom: 2pt solid #fbbf24;
    color: #000;
  }

  .lesson-content h3,
  .checkpoint-content h3 {
    font-size: 14pt;
    font-weight: 600;
    margin: 0.125in 0;
    color: #000;
  }

  .lesson-content p,
  .checkpoint-content p {
    margin: 0 0 0.125in 0;
    text-align: justify;
  }

  .lesson-content ul,
  .checkpoint-content ul {
    margin: 0.125in 0;
    padding-left: 0.25in;
  }

  .lesson-content li,
  .checkpoint-content li {
    margin: 0.0625in 0;
  }

  /* Discussion boxes */
  .lesson-content strong:first-of-type {
    display: block;
    font-weight: 700;
    margin-top: 0.125in;
  }

  /* Page Footer with Geometric Blocks */
  .page-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
  }

  .geometric-blocks {
    width: 100%;
    margin-bottom: 0;
  }

  .block-pattern {
    display: flex;
    height: 0.35in;
    width: 100%;
  }

  .block {
    flex: 1;
    position: relative;
  }

  /* Geometric block styles */
  .green-tri-white {
    background: #059669;
  }
  .green-tri-white::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    clip-path: polygon(0 0, 100% 100%, 0 100%);
  }

  .yellow-tri-white {
    background: #fbbf24;
  }
  .yellow-tri-white::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    clip-path: polygon(100% 0, 100% 100%, 0 0);
  }

  .green-rect {
    background: #059669;
  }

  .pink-tri-green {
    background: #059669;
  }
  .pink-tri-green::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ec4899;
    clip-path: polygon(0 0, 100% 100%, 0 100%);
  }

  .pink-rect {
    background: #ec4899;
  }

  .pink-tri-yellow {
    background: #fbbf24;
  }
  .pink-tri-yellow::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ec4899;
    clip-path: polygon(0 0, 100% 100%, 0 100%);
  }

  .yellow-rect {
    background: #fbbf24;
  }

  .green-tri-pink {
    background: #059669;
  }
  .green-tri-pink::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ec4899;
    clip-path: polygon(100% 0, 100% 100%, 0 0);
  }

  /* Page Number Bar */
  .page-number {
    background: #fbbf24;
    border-top: 2pt solid #000;
    padding: 0.0625in 0;
    text-align: center;
  }

  .page-number p {
    margin: 0;
    font-size: 8pt;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #000;
  }

  /* Checkpoint-specific Footer */
  .checkpoint-footer {
    position: relative;
  }

  .checkpoint-shapes {
    padding: 0.25in 0.5in;
    background: white;
  }

  .shape-row-top,
  .shape-row-middle,
  .shape-row-bottom {
    display: flex;
    gap: 0.25in;
    margin-bottom: 0.25in;
    align-items: center;
    justify-content: center;
  }

  .pink-square-white-circle {
    width: 1.5in;
    height: 1.5in;
    background: #ec4899;
    border-radius: 0.125in;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .inner-circle-white {
    width: 1in;
    height: 1in;
    background: white;
    border-radius: 50%;
  }

  .blue-rect-yellow-circle {
    width: 1.75in;
    height: 1.25in;
    background: #2563eb;
    border-radius: 0.125in;
    position: relative;
    display: flex;
    align-items: flex-start;
    justify-content: center;
  }

  .inner-circle-yellow {
    width: 1.25in;
    height: 1.25in;
    background: #fbbf24;
    border-radius: 50%;
    position: absolute;
    top: -0.375in;
  }

  .yellow-block-text {
    background: #fbbf24;
    border-radius: 0.125in;
    padding: 0.25in 0.5in;
    text-align: center;
  }

  .yellow-block-text h2 {
    font-size: 20pt;
    font-weight: 900;
    margin: 0;
    border: none;
    padding: 0;
    line-height: 1.2;
  }

  .green-rect-large {
    width: 1.75in;
    height: 1.5in;
    background: #059669;
    border-radius: 0.125in;
  }

  .blue-rect-green-half {
    width: 1.75in;
    height: 1.5in;
    background: #2563eb;
    border-radius: 0.125in;
    position: relative;
    overflow: hidden;
  }

  .inner-half-circle {
    width: 1.75in;
    height: 1.75in;
    background: #059669;
    border-radius: 50%;
    position: absolute;
    bottom: 0;
    left: 0;
    transform: translateY(50%);
  }

  /* Intro Pages */
  .intro-content h1 {
    font-size: 32pt;
    font-weight: 700;
    margin: 0.25in 0;
    color: #000;
  }

  .intro-content h2 {
    font-size: 20pt;
    font-weight: 700;
    margin: 0.25in 0 0.125in 0;
    color: #000;
  }

  .intro-content p {
    margin: 0 0 0.125in 0;
    text-align: justify;
  }

  /* Ensure content doesn't overlap footer */
  .lesson-content,
  .checkpoint-content,
  .intro-content {
    margin-bottom: 2in;
  }

  /* Links - remove underlines for print */
  a {
    color: #000;
    text-decoration: none;
  }

  /* Ensure colors print correctly */
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    color-adjust: exact;
  }
}
