@page {
    size: A4;
    margin: 16mm 14mm 18mm;
}

.print-page {
    background: #f5f5f5;
    min-height: 100vh;
    padding: 1.5rem;
}

.print-document {
    max-width: 820px;
    margin: 0 auto;
    background: #fff;
    color: #111;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
    padding: 2.25rem 2rem 2.75rem;
}

.print-header {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #ddd;
    padding-bottom: 0.875rem;
}

.print-meta {
    font-size: 0.9rem;
    color: #555;
}

.print-prose {
    line-height: 1.65;
    font-size: 11.5pt;
}

.print-prose h1,
.print-prose h2,
.print-prose h3,
.print-prose h4,
.print-prose h5,
.print-prose h6 {
    break-after: avoid-page;
    page-break-after: avoid;
    break-inside: avoid-page;
    page-break-inside: avoid;
    margin-top: 1.4em;
    margin-bottom: 0.55em;
}

.print-prose p,
.print-prose li,
.print-prose blockquote {
    orphans: 3;
    widows: 3;
}

.print-prose table,
.print-prose figure,
.print-prose blockquote,
.print-prose pre,
.print-prose code,
.print-prose img,
.print-avoid-break {
    break-inside: avoid-page;
    page-break-inside: avoid;
}

.print-prose pre,
.print-prose code,
.print-prose blockquote,
.print-prose table {
    overflow: visible;
}

.print-prose img {
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.print-featured-image {
    display: block;
    width: 100%;
    height: 100mm;
    max-height: 100mm;
    object-fit: cover;
    object-position: center center;
}

.print-footer {
    margin-top: 2rem;
    border-top: 1px solid #ddd;
    padding-top: 0.625rem;
    font-size: 0.8rem;
    color: #666;
}

/* Event Print Styling */
.print-events-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.event-year-section {
    break-inside: avoid-page;
    page-break-inside: avoid;
    margin-bottom: 2rem;
}

.event-year-heading {
    font-size: 1.5rem;
    font-weight: 700;
    color: #003d8c;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #003d8c;
    break-after: avoid-page;
    page-break-after: avoid;
}

.event-month-section {
    break-inside: avoid-page;
    page-break-inside: avoid;
    margin-bottom: 1.25rem;
}

.event-month-heading {
    font-size: 1rem;
    font-weight: 600;
    color: #003d8c;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    break-after: avoid-page;
    page-break-after: avoid;
}

.event-item {
    break-inside: avoid-page;
    page-break-inside: avoid;
    border-left: 4px solid #003d8c;
    padding: 0.75rem 0.75rem 0.75rem 1rem;
    margin-bottom: 0.75rem;
    background-color: #fafafa;
    font-size: 0.95rem;
}

.event-title {
    font-weight: 600;
    color: #003d8c;
    margin: 0 0 0.25rem 0;
}

.event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: #555;
    margin-bottom: 0.25rem;
}

.event-tag-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    background-color: #d4a574;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 3px;
}

.event-location {
    font-size: 0.85rem;
    color: #666;
    margin-top: 0.25rem;
}

.event-description {
    font-size: 0.85rem;
    color: #777;
    margin-top: 0.5rem;
    line-height: 1.4;
}

.event-attire,
.event-visibility {
    font-size: 0.8rem;
    color: #888;
    display: inline-block;
    margin-right: 1rem;
    margin-top: 0.35rem;
}

.event-visibility-chip {
    display: inline-block;
    padding: 0.1rem 0.4rem;
    background-color: #e8e8e8;
    color: #444;
    font-size: 0.7rem;
    font-weight: 500;
    border-radius: 2px;
    margin-left: 0.35rem;
}

.print-page .event-item-layout {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.print-page .event-item-content {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    flex-direction: row;
    gap: 1.5rem;
}

.print-page .event-item-date {
    flex: 0 0 10rem;
    width: 10rem;
}

/* Mobile responsive print layout */
@media (max-width: 768px) {
    .print-document {
        max-width: 100%;
        padding: 1rem 1rem 1.5rem;
    }

    .event-year-heading {
        font-size: 1.25rem;
    }

    .event-month-heading {
        font-size: 0.9rem;
    }

    .event-item {
        font-size: 0.9rem;
        padding: 0.6rem 0.6rem 0.6rem 0.8rem;
    }

    .event-meta {
        flex-direction: column;
        gap: 0.25rem;
    }
}

@media print {
    html,
    body {
        margin: 0;
        padding: 0;
        background: #fff;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .no-print,
    nav,
    [role="navigation"],
    .print-hide {
        display: none !important;
    }

    .print-page,
    .print-document {
        max-width: none;
        width: auto;
        margin: 0;
        padding: 0;
        box-shadow: none;
        background: #fff;
    }

    a {
        text-decoration: none;
        color: inherit;
    }

    /* Event-specific print styles */
    .event-year-section {
        break-inside: avoid-page;
        page-break-inside: avoid;
    }

    .event-year-heading {
        break-after: avoid-page;
        page-break-after: avoid;
    }

    .event-month-section {
        break-inside: avoid-page;
        page-break-inside: avoid;
    }

    .event-month-heading {
        break-after: avoid-page;
        page-break-after: avoid;
    }

    .event-item {
        break-inside: avoid-page;
        page-break-inside: avoid;
    }

    .event-item-layout {
        display: flex !important;
        flex-direction: row !important;
        align-items: flex-start !important;
        justify-content: space-between !important;
        gap: 1rem !important;
    }

    .event-item-content {
        display: flex !important;
        flex: 1 1 auto !important;
        min-width: 0 !important;
        flex-direction: row !important;
        gap: 1.5rem !important;
    }

    .event-item-date {
        flex: 0 0 10rem !important;
        width: 10rem !important;
    }

    .event-item-actions,
    .event-item-actions a,
    .event-item-actions button {
        display: none !important;
    }

    .event-tag-badge {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}
