/* Print Stylesheet for Portfolio Website */

/* @page rules for basic page setup */
@page {
  size: a4 landscape; /* Standard US letter size, portrait orientation */
  /* margin: 0.5in; /* 0.5 inch margins all around */
}

/* First page can have different styling if needed 
@page :first {
  margin-top: 0.75in;  Slightly larger top margin on first page 
} */

/* Left pages (even-numbered) 
@page :left {
  margin-left: 0.75in;  Wider margin on the left for binding 
  margin-right: 0.5in;
} */

/* Right pages (odd-numbered) 
@page :right {
  margin-left: 0.5in;
  margin-right: 0.75in;  Wider margin on the right for binding 
} */

/* Media query for print */
@media print {
  /* General print settings */
  section.container {
    /* Avoid accidental page breaks inside elements */
    page-break-inside: avoid;
    /* Better text rendering */
    text-rendering: optimizeLegibility;
  }

  #content {
    section.container {
      max-height: 100%;
    }
  }

  /* Hide elements not needed in print */
  nav,
  footer,
  .social-icons,
  .contact-form,
  button,
  .mobile-menu,
  .scroll-to-top,
  .video-embed,
  .cookie-notice {
    display: none !important;
  }

  /* Basic page structure */
  body {
  }

  /* Typography adjustments */
  h1 {
    font-size: 24pt;
    text-align: left;
  }

  h2 {
    font-size: 16pt;
    text-align: left;
  }

  h3 {
    font-size: 8pt;
  }

  p,
  li {
    font-size: 8pt;
    text-align: justify;
  }

  img {
    max-height: 10%;
    max-width: 10%;
  }

  /* Portfolio project sections */
  .project {
    page-break-inside: avoid;
    margin-bottom: 1cm;
  }

  /* Main header/hero styling */
  .hero,
  header,
  .intro {
    text-align: center;
    margin-bottom: 1cm;
  }

  /* Layout for portfolio pieces */
  .portfolio-grid,
  .gallery {
    display: block; /* Override any grid or flex layouts */
  }

  .portfolio-item {
    break-inside: avoid;
    margin-bottom: 1cm;
    width: 100%;
  }

  /* Images */
  img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0.5cm auto;
    page-break-inside: avoid;
  }

  /* Links styling */
  a {
    text-decoration: none;
  }

  /* Show URLs for links */
  a[href]:after {
    content: ' (' attr(href) ')';
    font-size: 9pt;
    font-style: italic;
    color: var(--text-low-contrast);
  }

  /* Don't show URL for internal links and anchors */
  a[href^='#']:after,
  a[href^='javascript:']:after {
    content: '';
  }

  /* Tables */
  table {
    width: 100%;
    border-collapse: collapse;
    page-break-inside: avoid;
    margin: 0.5cm 0;
  }

  th,
  td {
    border: 1px solid #ddd;
    padding: 0.2cm;
    text-align: left;
  }

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

  /* Resume/CV specific */
  .experience-item,
  .education-item,
  .skill-section {
    break-inside: avoid;
    margin-bottom: 0.5cm;
  }

  /* Skills/tools list */
  .skills-list {
    column-count: 2;
    column-gap: 1cm;
    margin: 0.5cm 0;
  }

  /* Contact information */
  .contact-info {
    margin-top: 0.5cm;
    border-top: 1pt solid #ccc;
    padding-top: 0.3cm;
    font-size: 10pt;
    text-align: center;
  }

  /* Add page numbers */
  @page {
    @bottom-center {
      content: counter(page) ' / ' counter(pages);
      font-size: 9pt;
      color: var(--text-low-contrast);
      font-family: var(--font-sans), Arial, sans-serif;
    }
  }

  /* Fix for background colors and images */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* Code snippets */
  pre,
  code {
    white-space: pre-wrap;
    font-size: 9pt;
    background-color: #f5f5f5 !important;
    border: 1px solid #ddd;
    padding: 0.2cm;
    page-break-inside: avoid;
  }
}
