/*
 * print.css — ondeinvestir.pt
 * Estilos para impressão e exportação PDF
 */

@media print {

    /* === Reset e base === */
    *, *::before, *::after {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    body {
        font-family: Georgia, "Times New Roman", serif;
        font-size: 12pt;
        line-height: 1.6;
        color: #000;
        background: #fff;
        margin: 0;
        padding: 0;
        max-width: 100%;
    }

    /* === Esconder elementos desnecessários === */
    #bolachas,
    #barra-progresso,
    #separador,
    #sidebar,
    #footer,
    footer,
    .footer-inner,
    #socialshare,
    #logosocial,
    .lermais,
    .relacionados,
    .authorbox,
    .etiqueta,
    .pub24,
    .nomobile,
    nav,
    .show-menu,
    input[type="checkbox"],
    script,
    iframe,
    .adsbygoogle {
        display: none !important;
    }

    /* === Cabeçalho simplificado === */
    #header {
        text-align: center;
        border-bottom: 2pt solid #000;
        padding-bottom: 10pt;
        margin-bottom: 20pt;
        height: auto !important;
        overflow: visible !important;
    }

    #header h1, #header h4 {
        font-size: 18pt;
        color: #000 !important;
    }

    #header p {
        font-size: 10pt;
        color: #555 !important;
    }

    /* === Conteúdo do artigo a largura total === */
    #content,
    #content670,
    #contentleft,
    #corpo,
    .post,
    .postwide {
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
        margin: 0 !important;
        padding: 0 !important;
        display: block !important;
    }

    /* === Título e meta do artigo === */
    h1 {
        font-size: 22pt;
        line-height: 1.3;
        margin-bottom: 6pt;
        page-break-after: avoid;
    }

    h2 { font-size: 16pt; page-break-after: avoid; }
    h3 { font-size: 14pt; page-break-after: avoid; }

    .meta-topo {
        font-size: 10pt;
        color: #555 !important;
        margin-bottom: 14pt;
        border-bottom: 0.5pt solid #ccc;
        padding-bottom: 6pt;
    }

    /* === Imagem de destaque === */
    .imagem-destaque {
        width: 100%;
        margin-bottom: 16pt;
        page-break-inside: avoid;
    }

    .imagem-destaque img {
        width: 100%;
        height: auto;
        max-height: 300pt;
        object-fit: cover;
    }

    /* === Imagens no corpo === */
    img {
        max-width: 100% !important;
        height: auto !important;
        page-break-inside: avoid;
    }

    .fotografia {
        float: left;
        margin: 0 12pt 8pt 0;
        max-width: 200pt;
    }

    /* === Links — mostrar URL por extenso === */
    a[href]::after {
        content: " [" attr(href) "]";
        font-size: 9pt;
        color: #555 !important;
        word-break: break-all;
    }

    /* Não mostrar URL em links de navegação internos */
    a[href^="#"]::after,
    a[href^="javascript"]::after {
        content: "";
    }

    /* === Parágrafos e texto === */
    p {
        orphans: 3;
        widows: 3;
        margin-bottom: 10pt;
    }

    blockquote {
        border-left: 3pt solid #000;
        padding-left: 12pt;
        margin: 12pt 0;
        font-style: italic;
    }

    /* === Tabelas === */
    table {
        border-collapse: collapse;
        width: 100%;
        page-break-inside: auto;
    }

    tr { page-break-inside: avoid; }

    th, td {
        border: 0.5pt solid #000;
        padding: 4pt 6pt;
        text-align: left;
    }

    th { font-weight: bold; }

    /* === Rodapé de impressão === */
    #corpo::after {
        content: "ondeinvestir.pt  —  Artigo disponível em: " attr(data-url);
        display: block;
        margin-top: 24pt;
        padding-top: 8pt;
        border-top: 0.5pt solid #000;
        font-size: 9pt;
        color: #555 !important;
    }

    /* === Quebras de página === */
    .postmeta { page-break-before: avoid; }
    .clear { display: none; }
}
