/* 
 * Swiss Design Print Stylesheet
 * Optimized for A4/Letter paper (210mm × 297mm / 8.5" × 11")
 * Maintains grid precision and typographic hierarchy
 */

@media print {
  /* Reset and Paper Setup */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }

  @page {
    size: A4;
    margin: 20mm 15mm;
  }

  html,
  body {
    width: 210mm;
    height: 297mm;
  }

  /* Hide Non-Print Elements */
  header[data-component="header"],
  footer[data-component="footer"],
  nav,
  .no-print,
  button,
  [aria-label="Toggle navigation menu"],
  #mobile-menu,
  script,
  .btn-swiss,
  .btn-swiss-primary,
  .btn-swiss-accent {
    display: none !important;
  }

  /* Typography for Print */
  body {
    font-size: 11pt;
    line-height: 1.5;
    color: #000;
    background: #fff;
  }

  h1 {
    font-size: 28pt;
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 12pt;
    break-after: avoid;
  }

  h2 {
    font-size: 20pt;
    font-weight: 700;
    line-height: 1.2;
    margin-top: 18pt;
    margin-bottom: 10pt;
    break-after: avoid;
  }

  h3 {
    font-size: 14pt;
    font-weight: 700;
    margin-top: 14pt;
    margin-bottom: 8pt;
    break-after: avoid;
  }

  h4,
  h5,
  h6 {
    font-size: 12pt;
    font-weight: 700;
    margin-top: 12pt;
    margin-bottom: 6pt;
    break-after: avoid;
  }

  p {
    margin-bottom: 8pt;
    orphans: 3;
    widows: 3;
  }

  /* Swiss Grid for Print */
  .swiss-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 4mm;
  }

  .swiss-col-12 {
    grid-column: span 12;
  }
  .swiss-col-11 {
    grid-column: span 11;
  }
  .swiss-col-10 {
    grid-column: span 10;
  }
  .swiss-col-9 {
    grid-column: span 9;
  }
  .swiss-col-8 {
    grid-column: span 8;
  }
  .swiss-col-7 {
    grid-column: span 7;
  }
  .swiss-col-6 {
    grid-column: span 6;
  }
  .swiss-col-5 {
    grid-column: span 5;
  }
  .swiss-col-4 {
    grid-column: span 4;
  }
  .swiss-col-3 {
    grid-column: span 3;
  }
  .swiss-col-2 {
    grid-column: span 2;
  }
  .swiss-col-1 {
    grid-column: span 1;
  }

  /* Swiss Structural Lines */
  .swiss-divider {
    border-top: 2pt solid #000;
    margin: 12pt 0;
    break-after: avoid;
  }

  /* Definition Lists - Swiss Structure */
  dl {
    margin-bottom: 12pt;
  }

  dt {
    font-size: 9pt;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #666;
    margin-bottom: 4pt;
  }

  dd {
    margin-left: 0;
    margin-bottom: 8pt;
  }

  /* Lists */
  ul,
  ol {
    margin-left: 0;
    padding-left: 15pt;
    margin-bottom: 8pt;
  }

  li {
    margin-bottom: 4pt;
  }

  /* Links */
  a {
    color: #000;
    text-decoration: none;
  }

  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #666;
  }

  /* Images */
  img {
    max-width: 100%;
    height: auto;
    break-inside: avoid;
    border: 1pt solid #000;
  }

  /* Code Blocks */
  pre,
  code {
    font-family: "Courier New", Courier, monospace;
    font-size: 9pt;
    background: #f5f5f5;
    border: 1pt solid #ddd;
    padding: 2pt 4pt;
    break-inside: avoid;
  }

  pre {
    padding: 8pt;
    margin-bottom: 8pt;
    overflow: visible;
    white-space: pre-wrap;
  }

  /* Tables */
  table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 12pt;
    break-inside: avoid;
  }

  th,
  td {
    border: 1pt solid #000;
    padding: 4pt 6pt;
    text-align: left;
  }

  th {
    background-color: #000;
    color: #fff;
    font-weight: 700;
    font-size: 10pt;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  /* Blockquotes */
  blockquote {
    border-left: 3pt solid #000;
    padding-left: 12pt;
    margin: 12pt 0;
    font-style: italic;
    break-inside: avoid;
  }

  /* Page Break Utilities */
  .page-break-before {
    break-before: always;
  }

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

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

  /* Swiss Prose for Print */
  .prose-swiss {
    max-width: 100%;
  }

  .prose-swiss p {
    margin-bottom: 8pt;
  }

  .prose-swiss h2 {
    margin-top: 18pt;
    border-top: 2pt solid #000;
    padding-top: 12pt;
  }

  .prose-swiss h3 {
    margin-top: 14pt;
  }

  /* Print-Specific Header */
  main::before {
    content: "EVERYDAYAI by Keith Williams";
    display: block;
    font-size: 18pt;
    font-weight: 900;
    margin-bottom: 12pt;
    padding-bottom: 8pt;
    border-bottom: 3pt solid #000;
    text-transform: uppercase;
    letter-spacing: -0.02em;
  }

  /* Print-Specific Footer */
  main::after {
    content: "Printed from {{ site.url }}";
    display: block;
    margin-top: 18pt;
    padding-top: 8pt;
    border-top: 1pt solid #000;
    font-size: 9pt;
    color: #666;
    text-align: center;
  }

  /* Avoid Page Breaks */
  article,
  section,
  .swiss-grid > div {
    break-inside: avoid;
  }

  /* Skills/Tech Lists for Print */
  ul[style*="list-style: none"] li {
    display: inline-block;
    margin-right: 8pt;
    padding: 2pt 6pt;
    border: 1pt solid #000;
    font-size: 9pt;
    margin-bottom: 4pt;
  }

  /* Metadata Badges */
  span[style*="background-color"] {
    background-color: #f0f0f0 !important;
    color: #000 !important;
    border: 1pt solid #000;
    padding: 2pt 6pt;
    font-size: 9pt;
    display: inline-block;
    margin-right: 4pt;
    margin-bottom: 4pt;
  }

  /* Swiss Red Accents - Print as Black */
  *[style*="--swiss-red"],
  *[style*="background-color: var(--swiss-red)"] {
    background-color: #000 !important;
    color: #fff !important;
  }

  *[style*="border-left: 4px solid var(--swiss-red)"],
  *[style*="border-top: 2px solid var(--swiss-red)"] {
    border-color: #000 !important;
  }

  /* Remove Shadows and Effects */
  *,
  *::before,
  *::after {
    box-shadow: none !important;
    text-shadow: none !important;
  }
}
