/* Paged.js - Advanced Print CSS */
@import url('https://fonts.googleapis.com/css2?family=Source+Sans+3:ital,wght@0,200..900;1,200..900&display=swap');

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

    @bottom-right {
        content: "Page " counter(page) " / " counter(pages);
        font-family: "Source Sans 3", sans-serif;
        font-size: 9pt;
        color: #64748b;
    }

    @bottom-left {
        content: var(--system-name, "RR26") " Bridge System";
        font-family: "Source Sans 3", sans-serif;
        font-size: 9pt;
        color: #64748b;
        font-weight: bold;
    }
    @bottom-center {
        content: "Confidentiel - Propriété " var(--system-name, "RR26");
        font-family: "Source Sans 3", sans-serif;
        font-size: 7pt;
        color: #94a3b8;
        text-transform: uppercase;
        letter-spacing: 0.1em;
    }
}

/* Base print styles */
@media print {
    body {
        background: white !important;
        color: black !important;
    }

    /* Hide web-only elements */
    .no-print, 
    .search-container, 
    nav, 
    footer.no-print {
        display: none !important;
    }

    /* Adjust content for print */
    main, .max-w-5xl {
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
    }

    /* System content specific (2 columns in print) */
    .system-content {
        display: block !important;
        column-count: 2 !important;
        column-gap: 1.2cm !important;
        column-fill: auto;
        width: 100% !important;
    }

    .system-content h2 {
        column-span: all;
        font-size: 14pt !important;
        margin-top: 0.8cm !important;
        margin-bottom: 0.4cm !important;
        border-bottom: 1.5pt solid black !important;
        page-break-after: avoid;
        color: black !important;
    }

    h1 {
        break-before: page;
    }

    h1:first-of-type {
        break-before: avoid;
    }

    /* Keep tables together */
    .table-container {
        break-inside: avoid;
        margin-bottom: 1em;
    }

    table {
        width: 100% !important;
        border-collapse: collapse !important;
    }

    th, td {
        border: 0.5pt solid #cbd5e1 !important;
        padding: 4pt !important;
        font-size: 9pt !important;
    }

    th {
        background-color: #f1f5f9 !important;
    }
}

/* Paged.js Specifics are handled in LayoutBase.astro style block */
