*
 * print.css - Centralized print styles for WebC components
 * Following Principle 2: Single Point of Change
 */

@media print {
  /* ---- GENERAL PRINT STYLES ---- */

  /* Hide JavaScript-only elements */
  .js-only,
  .js-enabled,
  [class*="js-"],
  .screen-reader-only {
    display: none !important;
  }

  /* Show noscript content */
  noscript {
    display: block !important;
  }

  /* Make NoScript content visible */
  [class*="-noscript"] {
    display: block !important;
    visibility: visible !important;
    position: static !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    clip: auto !important;
    margin: 1rem 0 !important;
  }

  /* Page break controls */
  h1, h2, h3 {
    page-break-after: avoid;
    page-break-inside: avoid;
  }

  img, figure, table {
    page-break-inside: avoid;
  }

  ul, ol, dl {
    page-break-before: avoid;
  }

  /* ---- COMPONENT-SPECIFIC STYLES ---- */

  /* Global component styles */
  .accordion-section,
  .tab-section,
  .faq-item,
  .element-card,
  .function-hierarchy-level,
  .comparison-table-row,
  .integration-element,
  .semiotic-element {
    page-break-inside: avoid;
  }

  /* 1. Accordion Component */
  .accordion-noscript .accordion-section {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #ccc;
    padding-bottom: 1rem;
  }

  .accordion-noscript h3 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
  }

  /* 2. FAQ Component */
  .faq-noscript dt {
    font-weight: bold;
    margin-top: 1rem;
  }

  .faq-noscript dd {
    margin-bottom: 1rem;
  }

  /* 3. Tabs Component */
  .tabs-noscript .tab-section {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #ccc;
    padding-bottom: 1rem;
  }

  .tabs-noscript h3 {
    margin-top: 1rem;
    margin-bottom: 0.5rem;
  }

  /* 4. Reflection Grid */
  .reflection-grid-noscript table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
  }

  .reflection-grid-noscript td {
    padding: 0.5rem;
    border: 1px solid #000;
    vertical-align: top;
  }

  /* 5. Comparison Table */
  .comparison-table-noscript table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
  }

  .comparison-table-noscript th,
  .comparison-table-noscript td {
    padding: 0.5rem;
    border: 1px solid #000;
    text-align: left;
  }

  .comparison-table-noscript th {
    background-color: #f0f0f0;
    font-weight: bold;
  }

  /* 6. Function Hierarchy */
  .function-hierarchy-noscript .hierarchy-level {
    margin-top: 1rem;
    font-weight: bold;
  }

  .function-hierarchy-noscript .hierarchy-subtypes {
    margin-left: 1.5rem;
  }

  /* 7. Core-to-Edge */
  .core-to-edge-noscript .core-section {
    margin-bottom: 1rem;
    padding: 0.5rem;
    border: 1px solid #000;
  }

  .core-to-edge-noscript .edge-elements-list {
    margin-left: 1.5rem;
  }

  /* 8. Integration Diagram */
  .integration-diagram-noscript .noscript-center {
    margin-bottom: 1rem;
    padding: 0.5rem;
    border: 1px solid #000;
    text-align: center;
  }

  .integration-diagram-noscript .noscript-elements {
    display: block;
    margin: 1rem 0;
  }

  /* 9. Semiotic Model */
  .semiotic-model-noscript .noscript-relationships {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
  }

  .semiotic-model-noscript th,
  .semiotic-model-noscript td {
    padding: 0.5rem;
    border: 1px solid #000;
    text-align: left;
  }

  /* 10. Reflection Rhombus */
  .reflection-rhombus-noscript .rhombus-elements-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
  }

  .reflection-rhombus-noscript th,
  .reflection-rhombus-noscript td {
    padding: 0.5rem;
    border: 1px solid #000;
    text-align: left;
  }

  /* 11. Hero Rhombus */
  .hero-rhombus-noscript h1 {
    margin-top: 0;
    font-size: 2rem;
  }

  .hero-rhombus-noscript h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }

  /* 12. Tags */
  .tags-noscript .tags-list {
    display: block;
    margin: 0.5rem 0;
    padding: 0;
  }

  .tags-noscript .tag-item {
    display: inline-block;
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
  }

  /* Transform colored elements to B&W printing patterns */
  [class*="element-object-blue"],
  [class*="noscript-object-blue"] {
    border-left: 3px solid #000 !important;
  }

  [class*="element-subject-gold"],
  [class*="noscript-subject-gold"] {
    border-left: 3px dashed #000 !important;
  }

  [class*="element-dialog-red"],
  [class*="element-intersubjective-red"],
  [class*="noscript-intersubjective-red"] {
    border-left: 3px dotted #000 !important;
  }

  [class*="element-medial-purple"],
  [class*="noscript-medial-purple"] {
    border-left: 3px double #000 !important;
  }
}
