/**
 * Print Styles for Provider Pages
 *
 * This stylesheet is applied when printing provider profile pages
 */

@media print {
    /* Hide elements that shouldn't be printed */
    .site-header,
    .site-footer,
    .site-inner > .wrap > header,
    .site-inner > .wrap > footer,
    header,
    footer,
    .footer-section,
    .genesis-nav-menu,
    .nav-primary,
    .nav-secondary,
    .provider-nav-links,
    .provider-actions,
    nav,
    .sidebar,
    .find-provider-left-side,
    .show-more-reviews,
    .show-less-reviews,
    #share-provider,
    #print-provider,
    #provider-name-search,
    .provider-filters,
    .provider_filter,
    input[type="text"],
    select,
    form,
    .page-banner,
    .provider-header,
    .find-provider-header {
        display: none !important;
    }

    /* Completely hide Genesis header and footer structures */
    .site-header,
    .site-footer,
    .title-area,
    .widget-area,
    .header-widget-area,
    .footer-widgets {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Force remove any spacing from hidden elements */
    .site-header + *,
    header + * {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    /* Ensure site-inner starts at top of page */
    .site-inner {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    /* Remove any top spacing from main content containers */
    .content-sidebar-wrap,
    .content,
    main {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    /* Force the provider card to start at the top */
    .find-provider-right-side:first-of-type {
        margin-top: 0 !important;
        padding-top: 20pt !important;
    }

    /* Page setup */
    @page {
        margin: 1.5cm;
        size: letter portrait;
    }

    html {
        margin: 0 !important;
        padding: 0 !important;
    }

    body {
        font-size: 12pt;
        line-height: 1.5;
        color: #000;
        background: #fff;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Remove all top margins from everything at the start */
    body > *:first-child,
    .site-container > *:first-child,
    .site-inner > *:first-child,
    .wrap > *:first-child {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    /* Make content full width */
    .site-inner,
    .content-sidebar-wrap,
    .content,
    .entry-content,
    main,
    article,
    .find-provider-right-side {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        float: none !important;
    }

    /* Reset any container widths */
    .wrap,
    .site-container {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Provider Card */
    .find-provider-right-side {
        border: 2px solid #000 !important;
        page-break-inside: avoid;
        margin-bottom: 20pt;
    }

    .find-provider-doctors {
        display: block !important;
        page-break-inside: avoid;
    }

    /* Provider Image */
    .doctors-picture img {
        max-width: 200px !important;
        height: auto !important;
        page-break-inside: avoid;
    }

    /* Provider Details */
    .doctors-details h2 {
        font-size: 18pt;
        margin-bottom: 10pt;
        color: #000;
    }

    .doctors-details ul {
        list-style: none;
        padding: 0;
        margin: 10pt 0;
    }

    .doctors-details li {
        margin: 5pt 0;
        font-size: 11pt;
    }

    /* Star Rating */
    .provider-rating {
        margin: 10pt 0;
        page-break-inside: avoid;
    }

    .stars {
        font-size: 14pt;
        color: #ffd700;
    }

    /* Star Rating Styles with Partial Stars for Print */
    .star {
        display: inline-block;
        position: relative;
        width: 1em;
    }

    .star-full {
        color: #ffd700;
    }

    .star-empty {
        color: #d3d3d3;
    }

    .star-quarter,
    .star-half,
    .star-three-quarter {
        position: relative;
        color: #d3d3d3;
        display: inline-block;
    }

    .star-quarter::before,
    .star-half::before,
    .star-three-quarter::before {
        content: '★';
        position: absolute;
        left: 0;
        top: 0;
        color: #ffd700;
        overflow: hidden;
        height: 100%;
    }

    .star-quarter::before {
        width: 25%;
    }

    .star-half::before {
        width: 50%;
    }

    .star-three-quarter::before {
        width: 75%;
    }

    .rating-text {
        font-size: 10pt;
        color: #666;
    }

    /* Availability badges */
    .doctors-buttons ul {
        list-style: none;
        padding: 0;
        margin: 10pt 0;
    }

    .doctors-buttons li {
        display: inline-block;
        padding: 3pt 8pt;
        margin: 3pt;
        border: 1px solid #000;
        font-size: 9pt;
        border-radius: 3pt;
    }

    /* Content Sections */
    .content-section {
        page-break-inside: avoid;
        margin-bottom: 15pt;
        border-bottom: 1px solid #ccc;
        padding-bottom: 15pt;
    }

    .content-section:last-child {
        border-bottom: none;
    }

    .content-section h3 {
        font-size: 14pt;
        margin-bottom: 10pt;
        color: #000;
        border-bottom: 2px solid #000;
        padding-bottom: 5pt;
    }

    /* About Section */
    #about-section p {
        font-size: 11pt;
        line-height: 1.6;
        text-align: justify;
    }

    /* Highlights Section */
    #highlights-section ul {
        list-style: disc;
        padding-left: 20pt;
    }

    #highlights-section li {
        margin: 5pt 0;
        font-size: 11pt;
    }

    /* Location Section */
    #locations-section .location-item {
        page-break-inside: avoid;
        margin-bottom: 15pt;
    }

    #locations-section h4 {
        font-size: 12pt;
        margin-bottom: 8pt;
    }

    #locations-section p,
    #locations-section address {
        font-size: 10pt;
        margin: 3pt 0;
        font-style: normal;
    }

    /* Hide Google Maps - not printable */
    #map,
    .acf-map,
    iframe {
        display: none !important;
    }

    /* Reviews Section */
    #reviews-section .review-item {
        page-break-inside: avoid;
        margin-bottom: 12pt;
        padding: 10pt;
        border: 1px solid #ddd;
        background: #f9f9f9;
    }

    .review-item .stars {
        font-size: 12pt;
    }

    .review-item .review-comment {
        font-size: 10pt;
        margin: 8pt 0;
        font-style: italic;
    }

    .review-item .review-date {
        font-size: 9pt;
        color: #666;
    }

    /* Show all reviews when printing (even those hidden by pagination) */
    .review-item[style*="display:none"],
    .review-item[style*="display: none"] {
        display: block !important;
    }

    /* Review Summary */
    .review-summary {
        page-break-inside: avoid;
        margin-bottom: 15pt;
        padding: 10pt;
        background: #f0f0f0;
        border: 1px solid #000;
    }

    .review-summary h4 {
        font-size: 13pt;
        margin-bottom: 8pt;
    }

    /* Links - show URL after link text */
    a[href]:after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        color: #666;
    }

    /* Don't show URLs for anchors and javascript links */
    a[href^="#"]:after,
    a[href^="javascript:"]:after,
    a[href^="tel:"]:after,
    a[href^="mailto:"]:after {
        content: "";
    }

    /* Contact Information - make prominent */
    .contact-phone {
        font-size: 12pt;
        font-weight: bold;
        color: #000;
    }

    /* Ensure good page breaks */
    h2, h3, h4 {
        page-break-after: avoid;
    }

    ul, ol, p {
        orphans: 3;
        widows: 3;
    }

    /* Two Column Layout for Print */
    .provider-layout-container {
        display: block !important;
    }

    .provider-content-column {
        width: 100% !important;
        margin-bottom: 15pt;
    }

    .provider-sidebar-column {
        width: 100% !important;
        page-break-before: avoid;
    }

    .provider-contact-card {
        padding: 0 !important;
        margin-bottom: 15pt;
        page-break-inside: avoid;
    }

    .contact-button {
        margin-bottom: 8pt;
    }

    .contact-button a {
        display: block;
        padding: 8pt;
        border: 1pt solid #004976;
        text-align: center;
        text-decoration: none;
        color: #004976 !important;
        font-weight: bold;
    }

    .availability-list {
        margin-top: 10pt;
    }

    .availability-list ul {
        list-style: none;
        padding: 0;
        margin: 5pt 0;
    }

    .availability-list li {
        font-size: 11pt;
        line-height: 1.4;
        margin-bottom: 3pt;
        display: flex;
        position: relative;
    }

    .availability-list li:before {
        content: "\2022";
        font-weight: bold;
        display: inline-block;
        padding-right: 8pt;
        font-size: 16pt;
    }

    .availability-list li.accepting_new_patients:before {
        color: #24912e;
    }

    .availability-list li.virtual_visits:before {
        color: #004976;
    }

    .availability-list li.referral_required:before {
        color: #e1671e;
    }

    /* No print header - content only */

    /* Footer for print - add page numbers */
    @page {
        @bottom-right {
            content: "Page " counter(page) " of " counter(pages);
            font-size: 9pt;
            color: #666;
        }
    }

    /* Force black and white for better printing */
    * {
        -webkit-print-color-adjust: economy !important;
        print-color-adjust: economy !important;
    }

    /* But keep essential colors */
    .stars,
    .provider-rating .stars {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color: #ffd700 !important;
    }

    /* Make sure content doesn't overflow */
    * {
        max-width: 100% !important;
    }

    img {
        max-width: 100% !important;
        height: auto !important;
    }

    /* Two-column layout for some sections to save paper */
    @media print and (min-width: 600pt) {
        .highlights-grid,
        .services-grid {
            column-count: 2;
            column-gap: 20pt;
        }
    }
}
