/* Print Styles for Policy Documents */

@media print {
    /* Hide elements not needed in print */
    footer {
        display: none;
    }

    /* Page setup */
    @page {
        margin: 2cm 1.5cm;
        size: A4;
    }

    body {
        font-size: 10pt;
        line-height: 1.4;
        color: #000 !important;
        background: #fff;
    }

    /* Force all text to be black */
    * {
        color: #000 !important;
    }

    /* Print Header - 3 columns */
    .print-header {
        display: table;
        width: 100%;
        margin-bottom: 20px;
        padding-bottom: 10px;
        border-bottom: 2px solid #000;
        page-break-after: avoid;
    }

    .print-header-left,
    .print-header-center,
    .print-header-right {
        display: table-cell;
        vertical-align: top;
        width: 33.33%;
    }

    .print-header-left {
        text-align: left;
    }

    .print-header-left img {
        max-width: 180px;
        height: auto;
    }

    .print-header-center {
        text-align: left;
        padding: 0 10px;
        font-size: 9pt;
        line-height: 1.3;
    }

    .print-header-right {
        text-align: right;
        font-size: 12pt;
    }

    .print-header-right .policy-name {
        font-weight: bold;
        margin-bottom: 5px;
        font-size: 18pt;
    }

    .print-header-right .effective-date {
        font-size: 11pt;
        color: #333;
    }

    /* Hide the original title section and policy date in print */
	/* The dual level of selectors ensures higher specificity to override other styles */
	.content .content-title {
        display: none;
    }

    .policy-date {
        display: none;
    }

    .policy-return {
        display: none;
    }

    /* Hide content boxes that only contain links (e.g., subpolicy references) */
    .content-box > a:only-child {
        display: none;
    }

    .content-box:has(> a:only-child) {
        display: none;
    }

    /* Content adjustments */
    .policy-content {
        page-break-before: avoid;
    }

    .content-box {
        page-break-inside: avoid;
        margin-bottom: 15px;
        box-shadow: none;
        padding: 0;
        margin-left: 0;
        margin-right: 0;
    }

    .content {
        box-shadow: none;
        background: none;
        padding: 0 !important;
        margin: 0 !important;
    }

    .policies-section {
        padding: 0 !important;
        margin: 0 !important;
    }

    .content-box h2 {
        font-size: 12pt;
        margin-top: 10px;
        margin-bottom: 8px;
        page-break-after: avoid;
        color: #000 !important;
    }

    .content-box p,
    .content-box li {
        font-size: 10pt;
        line-height: 1.4;
        color: #000 !important;
    }

    h1, h2, h3, h4, h5, h6, p, li, span, div {
        color: #000 !important;
    }

    .content-box ul,
    .content-box ol {
        margin-left: 20px;
    }

    /* Ensure links are visible in print */
    a[href]:after {
        content: none;
    }
}

