﻿/*
 * ============================================================================
 * Copyright (c) 2025 ATH SOLUTIONS (PTY) LTD. All rights reserved.
 * KwaZulu-Natal, Republic of South Africa.
 * ============================================================================
 *
 * @BEGIN Developer Log Header Block
 * @FILENAME: print.css
 * @TITLE: Wexford Lodge - Member Portal
 * @DESCRIPTION: Print stylesheet. Hides navigation, sidebar, topbar, and interactive elements. Ensures lodge logo, print header, and page numbers appear on all printed output. Page break rules for cards, tables, and headings.
 * @AUTHOR: Ary van der Pijl
 * @COMPANY: ATH SOLUTIONS (PTY) LTD
 * @WEBSITE: https://www.ath.solutions/
 * @EMAIL: info@ath.solutions
 * @COPYRIGHT: All Rights Reserved
 * @LICENSE: ATH SOLUTIONS - PROPRIETARY SOFTWARE LICENCE AGREEMENT (https://www.ath.solutions/documents/ath_solutions_software_licence_agreement.pdf)
 *
 * BEGIN CHANGELOG
 * @IMPORTANT NOTICE: Developers working on these files MUST update and maintain the Developers Change Log, failure to do is not an option:
 * !==================================================================================================================================================================
 * VERSION 1.0.0.4
 * - File Modified | Ary van der Pijl | 2026/07/11 | CSS-007 | Added a base (non-media) display:none for .print-header/.print-footer so the letterhead markup now wired into invoice_show.php stays hidden on screen and only appears via the existing @media print rules. |
 * VERSION 1.0.0.3
 * - File Modified | Ary van der Pijl | 2026/07/11 | CSS-003 | Replaced all hardcoded hex values (6x repeated #1B2A4A plus #000/#fff/#ccc/#555/#888) with tokens.css custom-property references; CSS custom properties work fine inside @media print. |
 * VERSION 1.0.0.2
 * - File Modified | Ary van der Pijl | 2026/06/19 | STANDARDS-COMPLIANCE | Applied ATH Solutions 2026 coding standards. |
 * VERSION 1.0.0.1
 * + File Created, Ary van der Pijl, 2026/06/13
 * ==================================================================================================================================================================!
 * END CHANGELOG
 */

/* Print-only letterhead markup - hidden on screen, shown via @media print below. */
.print-header,
.print-footer {
  display: none;
}

@media print {
  /* ─────────────────────────────────────────────────────────────────────
     PAGE SETUP
  ───────────────────────────────────────────────────────────────────── */

  @page {
    size: A4;
    margin: 20mm 15mm 25mm;
  }

  @page :first {
    margin-top: 15mm;
  }

  /* ─────────────────────────────────────────────────────────────────────
     BODY RESET
  ───────────────────────────────────────────────────────────────────── */

  *,
  *::before,
  *::after {
    box-shadow: none !important;
    text-shadow: none !important;
  }

  body {
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 11pt;
    color: var(--color-neutral-950);
    background: var(--color-surface);
    margin: 0;
  }

  /* ─────────────────────────────────────────────────────────────────────
     HIDE NON-PRINT ELEMENTS
  ───────────────────────────────────────────────────────────────────── */

  .sidebar,
  .topbar,
  .toast-container,
  nav,
  .no-print,
  .btn,
  .btn-group,
  .pagination,
  .modal,
  .modal-backdrop,
  .alert__close,
  .topbar__icon-btn,
  [data-bs-dismiss],
  #confirmModal {
    display: none !important;
  }

  /* ─────────────────────────────────────────────────────────────────────
     LAYOUT - FULL WIDTH
  ───────────────────────────────────────────────────────────────────── */

  .app-shell,
  .app-shell--collapsed {
    margin-left: 0 !important;
  }

  .main-content {
    padding: 0 !important;
  }

  /* ─────────────────────────────────────────────────────────────────────
     TYPOGRAPHY
  ───────────────────────────────────────────────────────────────────── */

  h1 {
    font-size: 20pt;
  }

  h2 {
    font-size: 16pt;
  }

  h3 {
    font-size: 13pt;
  }

  h4 {
    font-size: 12pt;
  }

  h5, h6 {
    font-size: 11pt;
  }

  h1, h2, h3, h4, h5, h6 {
    font-family: Georgia, serif;
    color: var(--color-navy-700);
    page-break-after: avoid;
  }

  /* ─────────────────────────────────────────────────────────────────────
     LINKS
  ───────────────────────────────────────────────────────────────────── */

  a[href]::after {
    content: " ("attr(href) ")";
    font-size: 9pt;
    color: var(--color-text-secondary);
  }

  a[href^="#"]::after,
  a[href^="javascript:"]::after {
    content: "";
  }

  /* ─────────────────────────────────────────────────────────────────────
     CARDS & TABLES
  ───────────────────────────────────────────────────────────────────── */

  .card {
    border: 1px solid var(--color-border-strong);
    border-radius: 0;
    box-shadow: none;
    page-break-inside: avoid;
  }

  .card-header {
    background: var(--color-navy-700) !important;
    color: var(--color-surface) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .table thead th {
    background: var(--color-navy-700) !important;
    color: var(--color-surface) !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .table {
    page-break-inside: auto;
    font-size: 9pt;
  }

  tr {
    page-break-inside: avoid;
    page-break-after: auto;
  }

  thead {
    display: table-header-group;
  }

  /* ─────────────────────────────────────────────────────────────────────
     PRINT HEADER (lodge logo + name)
  ───────────────────────────────────────────────────────────────────── */

  .print-header {
    display: flex !important;
    align-items: center;
    gap: 12pt;
    margin-bottom: 16pt;
    padding-bottom: 8pt;
    border-bottom: 2px solid var(--color-navy-700);
  }

  .print-header__logo {
    width: 48pt;
    height: 48pt;
    object-fit: contain;
  }

  .print-header__name {
    font-family: Georgia, serif;
    font-size: 18pt;
    font-weight: bold;
    color: var(--color-navy-700);
    letter-spacing: 0.05em;
  }

  .print-header__subtitle {
    font-size: 9pt;
    color: var(--color-text-secondary);
  }

  /* ─────────────────────────────────────────────────────────────────────
     PRINT FOOTER (date + page numbers)
  ───────────────────────────────────────────────────────────────────── */

  .print-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex !important;
    justify-content: space-between;
    font-size: 8pt;
    color: var(--color-neutral-500);
    padding-top: 6pt;
    border-top: 1px solid var(--color-border-strong);
  }
}