/**
 * Print Styles
 * Optimized for printing pages from this theme
 * 
 * Best practices applied:
 * - Hide non-essential UI elements
 * - Black text on white background for readability
 * - Show URLs after links
 * - Proper page break handling
 * - Ink-saving optimizations
 */

@media print {
    
    /* ==========================================================================
       Reset & Base Styles
       ========================================================================== */
    
    *,
    *::before,
    *::after {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    body {
        font-family: Georgia, "Times New Roman", Times, serif;
        font-size: 12pt;
        line-height: 1.5;
        margin: 0;
        padding: 20pt;
    }
    
    /* ==========================================================================
       Hide Non-Essential Elements
       ========================================================================== */
    
    /* Navigation & Header Elements */
    header nav,
    .site-navigation,
    .main-navigation,
    .mobile-menu,
    .menu-toggle,
    .hamburger,
    
    /* Buttons & Interactive Elements */
    button,
    .button,
    .btn,
    input[type="submit"],
    .unit-view-details,
    .unit-card-footer,
    
    /* Forms & Filters */
    form,
    .unit-archive-filters,
    .filter-group,
    .search-form,
    
    /* Sidebars & Secondary Content */
    aside,
    .sidebar,
    .widget-area,
    
    /* Social & Sharing */
    .social-links,
    .share-buttons,
    .social-icons,
    
    /* Footer Elements */
    footer,
    .site-footer,
    
    /* Media Elements */
    video,
    audio,
    iframe,
    
    /* Misc UI Elements */
    .slick-dots,
    .slick-arrow,
    .slick-prev,
    .slick-next,
    .carousel-controls,
    .pagination,
    .no-print {
        display: none !important;
    }
    
    /* ==========================================================================
       Typography
       ========================================================================== */
    
    h1 {
        font-size: 24pt;
        margin-bottom: 12pt;
    }
    
    h2 {
        font-size: 18pt;
        margin-bottom: 10pt;
    }
    
    h3 {
        font-size: 14pt;
        margin-bottom: 8pt;
    }
    
    h4, h5, h6 {
        font-size: 12pt;
        margin-bottom: 6pt;
    }
    
    p {
        margin-bottom: 10pt;
        orphans: 3;
        widows: 3;
    }
    
    /* ==========================================================================
       Links - Show URLs
       ========================================================================== */
    
    a {
        text-decoration: underline;
        word-wrap: break-word;
    }
    
    /* Show URL after links (except anchors and javascript) */
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        font-weight: normal;
        color: #555 !important;
    }
    
    /* Don't show URL for these link types */
    a[href^="#"]::after,
    a[href^="javascript:"]::after,
    a[href^="tel:"]::after,
    a[href^="mailto:"]::after,
    .unit-card-title a::after {
        content: "";
    }
    
    /* Format phone and email links nicely */
    a[href^="tel:"]::before {
        content: "Phone: ";
    }
    
    a[href^="mailto:"]::before {
        content: "Email: ";
    }
    
    /* ==========================================================================
       Images
       ========================================================================== */
    
    img {
        max-width: 100% !important;
        height: auto !important;
        page-break-inside: avoid;
    }
    
    /* Ensure images print (override background: transparent) */
    .unit-card-image img,
    .gallery img,
    .hero-image img,
    figure img {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    /* ==========================================================================
       Page Breaks
       ========================================================================== */
    
    /* Avoid breaks inside these elements */
    .unit-card,
    article,
    blockquote,
    figure,
    table,
    ul,
    ol {
        page-break-inside: avoid;
    }
    
    /* Force breaks before these elements */
    h1,
    .page-hero {
        page-break-before: always;
    }
    
    /* Avoid breaks after headings */
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }
    
    /* First page hero shouldn't force a break */
    .site-main > .page-hero:first-child {
        page-break-before: auto;
    }
    
    /* ==========================================================================
       Layout Adjustments
       ========================================================================== */
    
    /* Reset grid layouts for print */
    #unit-listings-container {
        display: block !important;
    }
    
    .oj-row {
        display: block !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* ==========================================================================
       Unit Cards - Print Optimized
       ========================================================================== */
    
    .unit-card {
        display: block !important;
        border: 1pt solid #ccc !important;
        margin-bottom: 20pt;
        padding: 10pt;
        page-break-inside: avoid;
        box-shadow: none !important;
    }
    
    .unit-card-image {
        width: 200pt !important;
        height: auto !important;
        padding-top: 0 !important;
        float: left;
        margin-right: 15pt;
        margin-bottom: 10pt;
        position: relative;
    }
    
    .unit-card-image img {
        position: relative !important;
        width: 100% !important;
        height: auto !important;
    }
    
    .unit-card-content {
        padding: 0 !important;
        overflow: hidden;
    }
    
    .unit-card-title {
        font-size: 14pt;
        margin-bottom: 5pt;
    }
    
    .unit-card-title a {
        text-decoration: none;
    }
    
    .unit-card-address {
        font-size: 10pt;
        margin-bottom: 8pt;
    }
    
    .unit-card-specs {
        display: block !important;
        margin-bottom: 8pt;
    }
    
    .unit-spec {
        display: inline-block !important;
        margin-right: 15pt;
    }
    
    .unit-card-price {
        background: none !important;
        padding: 5pt 0 !important;
        text-align: left !important;
        border-top: 1pt solid #ccc;
    }
    
    .unit-price-value {
        font-size: 14pt !important;
    }
    
    /* Rent Special Banner - Print Version */
    .unit-card-special {
        background: none !important;
        border: 1pt solid #000 !important;
        color: #000 !important;
        padding: 5pt !important;
        margin-top: 8pt;
        font-style: italic;
    }
    
    .unit-card-special::before {
        content: "Special: ";
        font-weight: bold;
    }
    
    .unit-special-icon {
        display: none !important;
    }
    
    /* Clear floats after each card */
    .unit-card::after {
        content: "";
        display: table;
        clear: both;
    }
    
    /* ==========================================================================
       Page Hero - Print Version
       ========================================================================== */
    
    .page-hero {
        background: none !important;
        padding: 20pt 0 !important;
        text-align: left !important;
        border-bottom: 2pt solid #000;
        margin-bottom: 20pt;
    }
    
    .page-hero-title {
        font-size: 24pt;
        margin: 0;
    }
    
    /* ==========================================================================
       Single Unit Page
       ========================================================================== */
    
    .unit-detail-header {
        margin-bottom: 15pt;
    }
    
    .unit-gallery {
        page-break-inside: avoid;
    }
    
    .unit-amenities,
    .property-amenities {
        page-break-inside: avoid;
    }
    
    /* ==========================================================================
       Tables
       ========================================================================== */
    
    table {
        border-collapse: collapse;
        width: 100%;
    }
    
    th, td {
        border: 1pt solid #ccc;
        padding: 5pt;
        text-align: left;
    }
    
    thead {
        display: table-header-group;
    }
    
    tr {
        page-break-inside: avoid;
    }
    
    /* ==========================================================================
       Utility Classes
       ========================================================================== */
    
    /* Use these classes in HTML to control print behavior */
    .print-only {
        display: block !important;
    }
    
    .no-print {
        display: none !important;
    }
    
    /* ==========================================================================
       Print Header/Footer (Browser-controlled)
       ========================================================================== */
    
    @page {
        margin: 0.5in;
        size: letter;
    }
    
    @page :first {
        margin-top: 0.5in;
    }
    
}
