/* styles/print.css */

@media print {
  /* --- General Print Styles --- */

  body {
    font-family: 'Times New Roman', Times, serif;
    color: #000;
    background-color: #fff !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Hide non-essential elements for a clean print view */
  header[role="banner"] nav,
  header[role="banner"] button#burgerBtn,
  footer .flex-wrap,
  #mobileMenu,
  .mobile-menu-overlay,
  a[href="#main-content"] {
    display: none !important;
  }

  /* Adjust header for print */
  header[role="banner"] {
    position: static !important;
    box-shadow: none !important;
    border-bottom: 2px solid #000 !important;
    background: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    page-break-after: avoid;
  }
  
  header[role="banner"] a[href="/"] h2 {
    color: #000 !important;
    font-size: 1.5rem;
    text-align: center;
    width: 100%;
    margin: 0.5rem 0;
  }

  header[role="banner"] a[href="/"] div {
    display: none !important; /* Hide logo image in header */
  }

  main#main-content {
    padding-top: 1rem !important;
    padding-bottom: 1rem !important;
  }

  /* General link styles for print */
  a {
    color: #000;
    text-decoration: underline;
  }

  /* Avoid page breaks inside common elements */
  article, section, figure, .portfolio-img {
    page-break-inside: avoid;
  }

  img {
    max-width: 100% !important;
  }

  /* Footer adjustments */
  footer {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #ccc;
    text-align: center;
    page-break-before: auto;
  }

  footer p {
    color: #333 !important;
    font-size: 0.9rem;
  }

  /* --- Home Page Specific Print Styles --- */

  /* Hide the default home page content completely */
  .page-home .layout-content-container > div:not(.print-only) {
    display: none !important;
  }

  .page-home .layout-content-container > h2 {
    display: none !important;
  }

  /* This class will only be visible in print mode */
  .print-only {
    display: none !important;
  }

  .page-home .print-only {
    display: block !important;
    padding: 0.5in;
    max-width: 8.5in;
    margin: 0 auto;
    font-family: sans-serif;
    position: relative;
    z-index: 1;
  }

  .print-about h1 {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 1rem;
    text-align: left;
  }

  .print-about-content {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1rem;
  }

  .print-about-text {
    flex: 1;
  }
  
  .print-about p {
    font-size: 0.9rem;
    line-height: 1.4;
    margin-bottom: 1rem;
    text-align: left;
  }

  .print-profile-image {
    width: 150px;
    height: auto;
    object-fit: cover;
    border-radius: 4px;
  }

  .print-measurements {
    margin-top: 2rem;
    page-break-inside: avoid;
  }

  .print-measurements h2 {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 0.75rem;
  }

  .measurements-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.25rem 1rem;
    font-size: 0.9rem;
  }

  .measurements-grid div span {
    font-weight: bold;
    margin-right: 0.5rem;
  }

  .print-contact {
    text-align: left;
    margin-top: 2rem;
  }

  .print-contact a {
    font-size: 0.9rem;
    text-decoration: none;
    color: #000;
  }
  
  .print-contact a:after {
    content: "";
  }

  /* --- Other Pages Print Styles --- */
  
  /* Portfolio page specific print styles */
  
  /* Set proper page margins for all portfolio pages */
  @page {
    margin-top: 1in;
    margin-bottom: 0.5in;
    margin-left: 0.5in;
    margin-right: 0.5in;
  }
  
  .page-portfolio {
    page-break-before: auto;
    padding-top: 0.5in;
  }
  
  .page-portfolio main#main-content {
    padding-top: 0.75in !important;
  }
  
  .page-portfolio .grid {
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 0.3rem !important;
    padding: 0.5rem !important;
    margin: 0.25in 0 !important;
    page-break-before: auto;
    orphans: 3;
    widows: 3;
  }

  .page-portfolio article {
    page-break-inside: avoid;
    margin-bottom: 0.2rem;
    break-inside: avoid;
  }

  .page-portfolio article .portfolio-img,
  .page-portfolio article .relative {
    aspect-ratio: 3/4 !important;
  }

  .page-portfolio article h3 {
    font-weight: bold;
    font-size: 0.75rem !important;
    color: #000;
    margin-top: 0.25rem;
    line-height: 1.2;
  }

  .page-portfolio article p {
    font-size: 0.65rem !important;
    color: #333;
    margin-top: 0.125rem;
    line-height: 1.1;
  }

  /* Make other page titles more prominent */
  .page-about h1, .page-contact h1 {
    font-weight: bold;
    font-size: 1.5rem;
    color: #000;
  }

  .page-portfolio article p, .page-about p, .page-contact p {
    color: #333;
  }
}
