/**
 * Print Styles for Trusted Advisors Realty AG
 * Professional A4 layout for printing/PDF generation
 *
 * Optimized for:
 * - Clean, professional appearance
 * - Efficient ink usage
 * - Swiss business standards (A4 format)
 */

@media print {
    /* ===== PAGE SETUP ===== */
    @page {
        size: A4 portrait;
        margin: 2cm 1.5cm;
    }

    * {
        print-color-adjust: economy;
        -webkit-print-color-adjust: economy;
    }

    /* ===== RESET & BASICS ===== */
    * {
        background: transparent !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    html {
        font-size: 12pt;
    }

    body {
        color: #000 !important;
        background: #fff !important;
        font-family: 'Jost', Arial, sans-serif;
        line-height: 1.5;
        margin: 0;
        padding: 0;
    }

    /* ===== HIDE NON-PRINTABLE ELEMENTS ===== */
    .tar-navigation,
    .mobile-menu-toggle,
    .scroll-to-top,
    .tar-connect,
    button,
    [aria-hidden="true"],
    .hero-buttons,
    .btn,
    script,
    noscript,
    iframe,
    video,
    audio,
    /* Hide decorative footer elements */
    .footer-cta-strip,
    .footer-social-icon,
    .footer-social-links,
    .footer-nav-col {
        display: none !important;
    }

    /* ===== FOOTER - ESSENTIAL CONTENT VISIBLE ===== */
    footer {
        display: block !important;
        page-break-before: always; /* Start on new page */
        border-top: 2px solid #73574A; /* Trust Brown border */
        padding-top: 1em;
        margin-top: 2em;
        background: white !important;
    }

    .footer-main-v3,
    .footer-brand-v3,
    .footer-brand-info,
    .footer-copyright,
    .footer-contact-links,
    .footer-bottom-v3 {
        display: block !important;
        background: white !important;
    }

    /* Simplify footer grid for print */
    .footer-grid-v3 {
        display: block !important; /* Override grid */
    }

    .footer-bottom-v3 {
        background: white !important;
        color: black !important;
        border-top: 1px solid #ddd;
        padding: 0.5em 0;
        margin-top: 1em;
    }

    /* Footer logo for print */
    .tar-footer__logo-container {
        width: 60px;
        height: 60px;
        margin-bottom: 1em;
    }

    /* Contact information styling */
    .footer-contact-links {
        margin-top: 1em;
    }

    .footer-contact-link {
        display: block !important;
        color: black !important;
        margin-bottom: 0.5em;
        font-size: 10pt;
        text-decoration: none;
    }

    /* Copyright styling */
    .footer-copyright {
        font-size: 9pt;
        color: #666 !important;
        margin-top: 1em;
    }

    /* Footer text elements */
    .footer-brand-info p,
    .footer-brand-info address {
        font-size: 10pt;
        color: black !important;
        margin-bottom: 0.5em;
    }

    /* ===== TYPOGRAPHY ===== */
    h1, h2, h3, h4, h5, h6 {
        page-break-after: avoid;
        page-break-inside: avoid;
        font-weight: 600;
        color: #000;
    }

    h1 {
        font-size: 24pt;
        margin: 0 0 0.5em 0;
        border-bottom: 2px solid #73574A;
        padding-bottom: 0.25em;
    }

    h2 {
        font-size: 18pt;
        margin: 1em 0 0.5em 0;
    }

    h3 {
        font-size: 14pt;
        margin: 0.75em 0 0.5em 0;
    }

    p {
        margin: 0 0 0.75em 0;
        page-break-inside: avoid; /* Cross-browser support */
        orphans: 3; /* Chrome/Edge only - prevents minimum 3 lines at bottom of page */
        widows: 3;  /* Chrome/Edge only - prevents minimum 3 lines at top of page */
    }

    /* ===== LINKS ===== */
    a {
        color: #000;
        text-decoration: underline;
    }

    a[href^="http"]:after {
        content: " (" attr(href) ")";
        font-size: 90%;
        color: #666;
    }

    a[href^="#"]:after,
    a[href^="tel:"]:after,
    a[href^="mailto:"]:after {
        content: "";
    }

    /* ===== IMAGES & MEDIA ===== */
    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }

    /* Hide decorative images, keep content images */
    .hero-image,
    [src*="optimized/hero/"] {
        display: none !important;
    }

    /* ===== SECTIONS ===== */
    section {
        page-break-inside: avoid;
        margin-bottom: 2em;
    }

    /* ===== LOGO & HEADER ===== */
    .tar-logo {
        max-width: 120px !important;
        height: auto !important;
        margin-bottom: 1em;
    }

    .hero {
        padding: 0 !important;
        background: none !important;
        min-height: auto !important;
    }

    .hero-title {
        font-size: 20pt;
        color: #73574A;
        border-bottom: 2px solid #73574A;
        padding-bottom: 0.25em;
        margin-bottom: 1em;
    }

    .hero-text {
        font-size: 12pt;
        color: #333;
        margin-bottom: 1em;
    }

    /* ===== SERVICES SECTION ===== */
    .services {
        page-break-inside: avoid;
    }

    .service-card {
        border: 1px solid #ccc;
        padding: 0.75em;
        margin-bottom: 1em;
        page-break-inside: avoid;
    }

    .service-card h3 {
        margin-top: 0;
        color: #73574A;
    }

    /* ===== TEAM SECTION ===== */
    .team-grid {
        display: block !important;
    }

    .team-member {
        display: block;
        border: 1px solid #ddd;
        padding: 0.75em;
        margin-bottom: 1em;
        page-break-inside: avoid;
    }

    .team-member img {
        max-width: 80px !important;
        height: auto !important;
        float: left;
        margin-right: 1em;
    }

    .team-name {
        font-weight: 600;
        font-size: 11pt;
        margin: 0 0 0.25em 0;
    }

    .team-role {
        font-size: 10pt;
        color: #666;
        margin: 0 0 0.5em 0;
    }

    /* ===== PHILOSOPHY SECTION ===== */
    .philosophy {
        page-break-inside: avoid;
        padding: 1em;
        border: 1px solid #73574A;
        margin-bottom: 2em;
    }

    .philosophy-hero__title {
        color: #73574A;
        font-size: 16pt;
    }

    /* ===== CONTACT INFORMATION ===== */
    .contact-info {
        border-top: 2px solid #73574A;
        padding-top: 1em;
        margin-top: 2em;
        page-break-inside: avoid;
    }

    .contact-info h3 {
        color: #73574A;
        margin-top: 0;
    }

    .contact-item {
        margin-bottom: 0.5em;
        display: flex;
        align-items: center;
    }

    .contact-item svg {
        display: none;
    }

    /* ===== LISTS ===== */
    ul, ol {
        margin: 0 0 1em 1.5em;
        padding: 0;
    }

    li {
        margin-bottom: 0.25em;
    }

    /* ===== TABLES (if any) ===== */
    table {
        border-collapse: collapse;
        width: 100%;
        margin-bottom: 1em;
        page-break-inside: avoid;
    }

    th, td {
        border: 1px solid #ddd;
        padding: 0.5em;
        text-align: left;
    }

    th {
        background: #f5f5f5;
        font-weight: 600;
    }

    /* ===== PAGE BREAKS ===== */
    h2, h3, h4, h5, h6 {
        page-break-after: avoid;
    }

    img, table, figure {
        page-break-inside: avoid;
    }

    /* ===== FOOTER (if visible) ===== */
    .print-footer {
        display: block !important;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        text-align: center;
        font-size: 9pt;
        color: #666;
        border-top: 1px solid #ddd;
        padding-top: 0.5em;
    }

    .print-footer::after {
        content: "Trusted Advisors Realty AG | www.trustedadvisorsrealty.com";
    }

    /* ===== QUALITY & INK OPTIMIZATION ===== */
    * {
        background: white !important;
    }

    /* Simplify icons to text */
    .icon::before {
        content: "• ";
    }

    /* Remove decorative elements */
    ::before,
    ::after {
        background: none !important;
        box-shadow: none !important;
    }

    /* ===== GRID LAYOUT SIMPLIFICATION ===== */
    .container,
    .grid,
    .flex {
        display: block !important;
    }

    /* ===== ACCESSIBILITY ===== */
    abbr[title]::after {
        content: " (" attr(title) ")";
    }

    /* ===== LANGUAGE-SPECIFIC ADJUSTMENTS ===== */
    html[lang="de"] .print-footer::after {
        content: "Trusted Advisors Realty AG | www.trustedadvisorsrealty.com | Schweiz";
    }

    html[lang="en"] .print-footer::after {
        content: "Trusted Advisors Realty AG | www.trustedadvisorsrealty.com | Switzerland";
    }
}
