/* ==========================================================
   print.css - Versão Otimizada com Modo TXT (Doze Teclas)
   ========================================================== */

/* 1. Configuração da Página Física e Cabeçalho/Rodapé */
@page {
    size: A4;
    margin: 18mm 12mm 15mm 12mm; /* Aumentamos para 18mm para dar teto ao logo */
    background-color: #ffffff;
    
    @top-left {
        /* O seu SVG real estruturado horizontalmente e codificado em Base64 */
        content: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 450 100' width='135' height='30'%3E%3Cstyle%3E.st0%7Bfill:%23ffffff;%7D.st1%7Bfill:%238C8C8C;%7D%3C/style%3E%3Cg transform='scale(0.12) translate(0, -30)'%3E%3Cpath class='st0' d='M398.8,696.4l-0.6,0c-4.9-0.3-9.5-1.5-13.8-3.7l-74.1-36.8L82.9,542.2c-11-5.5-17.8-16.6-17.7-28.9l2.5-377.1c0.1-12.2,6.9-23.1,17.8-28.5c5.5-2.7,11.6-4.2,17.7-4.2c6.1,0,12.2,1.4,17.7,4.1L400,246.1l279.1-138.4c5.5-2.7,11.6-4.1,17.7-4.1c6.1,0,12.2,1.4,17.7,4.1c11,5.4,17.8,16.4,17.8,28.6l2.5,377.1c0.1,12.3-6.7,23.4-17.7,28.9L488.7,656.5l-73,36.2c-4.3,2.1-8.9,3.4-13.8,3.7l-0.6,0l-1.1,0L398.8,696.4z'/%3E%3Cpath class='st1' d='M710.5,136.4c0-3.9-2.2-7.4-5.7-9.1c-5-2.5-11-2.5-16,0L404.3,268.3c-1.2,0.6-2.5,1-3.9,1c-0.1,0-0.3,0-0.4,0c-0.1,0-0.3,0-0.4,0c-1.4-0.1-2.7-0.4-3.9-1L111.2,127.3c-5-2.5-10.9-2.5-16,0c-3.4,1.7-5.7,5.2-5.7,9.1L87,513.5c0,3.9,2.2,7.5,5.7,9.2l227.2,113.6l74.2,36.8c1.7,0.9,3.6,1.3,5.4,1.4c0.2,0,0.4,0,0.5,0c0.2,0,0.4,0,0.5,0c1.9-0.1,3.7-0.6,5.4-1.4l73-36.2l228.4-114.2c3.5-1.8,5.7-5.3,5.7-9.2L710.5,136.4z M168.9,530.6c0,2-2.1,3.2-3.8,2.3L112,506.4c-0.9-0.4-1.5-1.4-1.5-2.4V160c0-2,2.1-3.2,3.8-2.4l38.4,19.2c0.9,0.4,1.4,1.4,1.4,2.4V389c0,1,0.6,1.9,1.5,2.4l11.9,5.9c0.9,0.5,1.4,1.4,1.4,2.4V530.6z M244.7,568.5c0,2-2.1,3.2-3.8,2.3l-61.5-30.7c-0.9-0.4-1.5-1.3-1.5-2.3v-131c0-2,2.1-3.2,3.8-2.4l7.1,3.6c1.8,0.9,3.8-0.4,3.8-2.4V201c0-2,2.1-3.2,3.8-2.4l32,16c0.9,0.4,1.4,1.4,1.4,2.4v209.2c0,1,0.6,1.9,1.5,2.4l11.9,5.9c0.9,0.5,1.4,1.4,1.4,2.4L244.7,568.5L244.7,568.5z M320.4,606.3c0,2-2,3.2-3.8,2.3L255.1,578c-0.9-0.4-1.5-1.3-1.5-2.3V444c0-2,2.1-3.2,3.8-2.4l7.1,3.6c1.8,0.9,3.8-0.4,3.8-2.4V238.9c0-2,2.1-3.2,3.8-2.4l32,16c0.9,0.4,1.5,1.4,1.5,2.4v209.8c0,1,0.6,1.9,1.5,2.4l11.9,5.9c0.9,0.5,1.5,1.4,1.5,2.4L320.4,606.3L320.4,606.3z M387.8,640c0,2-2,3.2-3.8,2.3l-53.1-26.6c-0.9-0.4-1.5-1.3-1.5-2.3v-131c0-2,2.1-3.2,3.8-2.4l7.1,3.6c1.8,0.9,3.8-0.4,3.8-2.4V276.8c0-2,2.1-3.2,3.8-2.4l38.4,19.2c0.9,0.5,1.5,1.4,1.5,2.4V640z M498.1,599.7c0,1-0.6,1.9-1.5,2.3L416,642.4c-1.8,0.9-3.8-0.4-3.8-2.3V296c0-1,0.6-1.9,1.5-2.4l65.9-32.9c1.8-0.9,3.8,0.4,3.8,2.4v204.4c0,2,2.1,3.2,3.8,2.4l7.1-3.6c1.8-0.9,3.8,0.4,3.8,2.4L498.1,599.7L498.1,599.7z M594.6,551.5c0,1-0.6,1.9-1.5,2.3L510.9,595c-1.8,0.9-3.8-0.4-3.8-2.3V461.5c0-1,0.6-1.9,1.5-2.4l11.8-5.9c0.9-0.4,1.5-1.4,1.5-2.4V241.1c0-1,0.6-1.9,1.5-2.4l52.8-26.4c1.8-0.9,3.8,0.4,3.8,2.4v205.1c0,2,2.1,3.2,3.8,2.4l7.2-3.6c1.8-0.9,3.8,0.4,3.8,2.4V551.5z M689.5,504c0,1-0.6,1.9-1.5,2.4l-80.6,40.3c-1.8,0.9-3.8-0.4-3.8-2.3V413.9c0-1,0.6-1.9,1.5-2.4l11.8-5.9c0.9-0.4,1.5-1.4,1.5-2.4V192.9c0-1,0.6-1.9,1.5-2.4l65.8-32.9c1.8-0.9,3.8,0.4,3.8,2.4L689.5,504L689.5,504z'/%3E%3C/g%3E%3Ctext x='110' y='62' font-family='Segoe UI, sans-serif' font-weight='900' font-size='42' fill='%238C8C8C'%3EDOZE%3Ctspan font-weight='900'%3ETECLAS%3C/tspan%3E%3C/text%3E%3C/svg%3E");
        
        /* Ajustes de proporções para a folha */
        display: block !important;
        /* border-bottom: 1px solid #ddd; */
        padding-bottom: 6px;
        width: 100%;
    }
}
    
    @bottom-right {
        content: counter(page);
        font-family: 'Segoe UI', sans-serif;
        font-size: 9pt;
        color: #777777;
    }
    
    @bottom-left {
        content: "dozeteclas.com.br";
        font-family: 'Segoe UI', sans-serif;
        font-size: 9pt;
        color: #777777;
    }


/* 2. Reset e Otimização para Impressão */
* {
    box-sizing: border-box;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
}

body {
    background: #ffffff !important;
    color: #000000 !important;
    font-family: 'Segoe UI', sans-serif;
    margin: 0;
    padding: 0;
    font-size: 11pt;
    line-height: 1.2;
}

/* Ocultar elementos de interface */
.header-main,
.header-tools,
.tone-control-wrapper,
#tone-popup,
#preview-container,
#yt-player,
.btn-tool,
.tools-wrapper,
svg {
    display: none !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* 3. Área do Conteúdo Principal */
.content {
    margin-top: 0 !important; 
    margin-bottom: 0 !important;
    padding: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
}

.song-header {
    margin-top: 10px !important;
    margin-bottom: 15px !important; 
    border-left: 3.5pt solid #000000 !important;
    padding-left: 12px !important;
    page-break-inside: avoid !important;
}

.song-header h1 {
    margin: 0 0 2px 0 !important;
    font-size: 18pt !important;
    color: #000000 !important;
    font-weight: bold !important;
}

#view-artist {
    font-size: 11pt !important;
    color: #444444 !important;
    font-weight: bold !important;
    margin: 0 0 4px 0 !important;
}

#view-meta {
    color: #555555 !important;
    font-size: 8.5pt !important;
    font-weight: bold !important;
    margin-top: 2px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

/* 4. O Mecanismo de Renderização Linear */
#cifra-render {
    /* white-space: pre-wrap !important; */
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    max-width: 100% !important;
    background: transparent !important;
    color: #000000 !important;
}

#cifra-render .c-line {
    font-family: 'JetBrains Mono', monospace !important;
    line-height: 1.2 !important;
    white-space: pre !important;
    display: block !important;
    width: 100% !important;
    letter-spacing: 0 !important;
    color: #000000 !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 1.2em !important;
    break-inside: avoid-column !important;
    -webkit-column-break-inside: avoid !important;
    page-break-inside: avoid !important;
}

/* Eliminar espaços em branco indesejados no início */
#cifra-render > .c-line:first-child:empty,
.song-header + #cifra-render .c-line:first-child,
.section-label + .c-line:empty {
    display: none !important;
    height: 0 !important;
}

/* Acordes e Comentários */
.c-chord {
    color: #000000 !important; 
    font-weight: bold !important;
    font-family: inherit !important;
    letter-spacing: 0 !important;
}

.c-comment {
    color: #555555 !important;
    font-style: italic !important;
    display: inline-block !important;
    margin-top: 0.1em !important;
    margin-bottom: 0.1em !important;
}

/* Rótulos das Seções */
.section-label {
    display: inline-block !important;
    background-color: #f0f0f0 !important;
    color: #000000 !important;
    font-weight: bold !important;
    font-size: 10pt !important;
    border-radius: 3px !important;
    text-transform: uppercase !important;
    letter-spacing: 1px !important;
    margin-top: 10pt !important;
    margin-bottom: 4pt !important;
    padding: 2px 6px !important;
    border: 1px solid #dddddd !important;
    
    break-after: avoid !important;
    break-after: avoid-column !important;
    -webkit-column-break-after: avoid !important;
    page-break-after: avoid !important;
}

/* 5. Modos de Exibição de Duas Colunas */
.two-columns {
    display: block !important;
    width: 100% !important;
    column-count: 2 !important;
    column-gap: 30mm !important;
    column-rule: 0.5pt solid #dddddd !important;
    column-fill: balance !important;
    height: auto !important;
    max-height: none !important;
}

/* ==========================================================
   💥 CORREÇÃO DO MODO TXT PARA O PAPEL/PDF
   ========================================================== */

/* ==========================================================
   💥 REMOÇÃO DE ESPAÇOS EM BRANCO NO MODO TXT (VERSÃO DIAGNÓSTICO)
   ========================================================== */

/* ==========================================================
   💥 AJUSTES DO MODO TXT NO PRINT.CSS (VERSÃO FINAL BLINDADA)
   ========================================================== */

/* 1. Oculta o texto dos acordes visualmente no papel */
.only-text-mode .c-chord {
    display: none !important;
    visibility: hidden !important;
}

/* 2. ESMAGA a caixa física da linha que continha os acordes ocultados.
      Substitua a regra antiga por esta para zerar a altura no motor do PDF */
.only-text-mode #cifra-render .c-line:has(.c-chord):not(:has(.c-comment)) {
    height: 0px !important;
    min-height: 0px !important;
    max-height: 0px !important;
    line-height: 0 !important;
    font-size: 0px !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
}

/* 3. NOVO: Remove completamente as tags .c-line que estão 100% vazias,
      eliminando aquela linha órfã residual que vimos no inspetor */
.only-text-mode #cifra-render .c-line:empty {
    display: none !important;
    height: 0px !important;
    min-height: 0px !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 0 !important;
}

/* 4. Garante que as linhas que sobraram (letras puras) mantenham o fluxo ideal */
.only-text-mode #cifra-render .c-line:not(:has(.c-chord)) {
    display: block !important;
    min-height: 1.2em !important;
    line-height: 1.2 !important;
}