/**
 * reader_print.css
 *
 * Styling für die Druck- und Buchansicht kompletter Anleitungen.
 */

@font-face {
    font-family: "Helvetica Neue LT Pro";
    src: url("../fonts/HelveticaNeueLTPro_normal_normal_300.woff") format("woff");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

:root {
    --hb-red: #e2001a;
    --hb-bg: #f5f5f7;
    --hb-text: #111827;
    --hb-muted: #6b7280;
    --hb-border: #e5e7eb;
    --hb-dark: #111827;
    --hb-white: #ffffff;
    --hb-font-base: "Helvetica Neue LT Pro", Arial, Helvetica, "Microsoft YaHei", "SimSun", "Noto Sans CJK SC", "Noto Sans JP", "Noto Sans KR", sans-serif;
}

/* Basis */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    padding: 16px;
    background: var(--hb-bg);
    color: var(--hb-text);
    font-family: var(--hb-font-base);
    font-weight: 300;
}

button,
input,
select,
textarea {
    font: inherit;
    font-family: var(--hb-font-base);
}

/* Werkzeugleiste */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin: -16px -16px 16px;
    padding: 10px 16px 12px;
    background: var(--hb-dark);
    color: #e5e7eb;
}

.toolbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.toolbar-logo {
    flex-shrink: 0;
    display: block;
    width: auto;
    height: 28px;
}

.toolbar-textblock {
    min-width: 0;
}

.toolbar-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.toolbar-meta {
    color: #9ca3af;
    font-size: 12px;
    line-height: 1.4;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.toolbar button,
.toolbar a {
    padding: 7px 14px;
    border: 0;
    border-radius: 999px;
    background: #f9fafb;
    color: var(--hb-text);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
}

.toolbar button:hover,
.toolbar a:hover {
    background: #e5e7eb;
}

/* Druckseiten */
.print-wrapper {
    max-width: 175mm;
    margin: 0 auto;
}

.print-block {
    margin-bottom: 8mm;
    padding-bottom: 4mm;
    border-bottom: 1px solid var(--hb-border);
}

.print-block--cover {
    margin-bottom: 12mm;
    border-bottom: 0;
}

.block-header {
    margin-bottom: 2.5mm;
}

.block-title {
    margin: 0;
    color: var(--hb-red);
    font-size: 12pt;
    font-weight: 600;
}

.block-meta {
    color: var(--hb-muted);
    font-size: 9pt;
}

.block-header-cover {
    margin-bottom: 4mm;
}

.block-header-cover-logo {
    display: block;
    width: auto;
    height: 18mm;
}

.block-body {
    color: var(--hb-text);
    font-size: 10.5pt;
    line-height: 1.4;
    overflow-wrap: break-word;
}

.block-footer {
    display: flex;
    justify-content: space-between;
    gap: 8mm;
    margin-top: 3mm;
    color: var(--hb-muted);
    font-size: 8.5pt;
}

/* Typografie */
.block-body p,
.block-body h1,
.block-body h2,
.block-body h3,
.block-body h4,
.block-body ul,
.block-body ol,
.block-body table {
    max-width: 170mm;
}

.block-body h1,
.block-body h2,
.block-body h3,
.block-body h4 {
    margin-top: 0;
    margin-bottom: 3mm;
    color: #4b5563;
    font-weight: 600;
}

.block-body h1 {
    color: var(--hb-red);
    font-size: 16pt;
}

.block-body h2 {
    font-size: 14pt;
}

.block-body h3 {
    font-size: 12pt;
}

.block-body h4 {
    font-size: 11pt;
}

.block-body p {
    margin: 0 0 3mm;
}

.block-body ul,
.block-body ol {
    margin: 0 0 3mm 16px;
    padding-left: 0;
}

.block-body img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 3mm 0;
}

/* Cover */
.print-block--cover .hb-cover-meta {
    margin-top: 6mm;
    margin-bottom: 6mm;
}

.hb-cover-bar {
    margin-bottom: 4mm;
    padding: 3mm 5mm;
    background: #e5e7eb;
}

.hb-cover-bar-top {
    display: flex;
    flex-direction: column;
    gap: 1mm;
}

.hb-cover-line-main {
    color: var(--hb-text);
    font-size: 10pt;
    font-weight: 600;
}

.hb-cover-line-sub {
    color: #4b5563;
    font-size: 9pt;
}

.hb-cover-bar-bottom {
    position: relative;
    padding: 5mm 5mm 6mm;
}

.hb-cover-title-box {
    display: inline-block;
    padding: 3mm 7mm;
    background: var(--hb-white);
    box-shadow: 0 3px 6px rgba(15, 23, 42, 0.08);
    font-size: 13pt;
    font-weight: 600;
}

.hb-cover-lang-tag {
    position: absolute;
    top: 4mm;
    right: 6mm;
    color: #4b5563;
    font-size: 8pt;
    font-weight: 600;
    letter-spacing: 0.08em;
}

/* JS-Gruppierungen */
.hb-headline-block,
.hb-figure-block {
    margin-bottom: 3mm;
}

/* Importierte DocuGlobe-Elemente */
.block-body table {
    width: 100% !important;
    margin-top: 2mm;
    margin-bottom: 3mm;
    margin-left: 0 !important;
    border-collapse: collapse;
    table-layout: auto !important;
    font-size: 9.5pt;
}

.block-body table td,
.block-body table th {
    padding: 2px 4px;
    border: 1px solid var(--hb-border);
    vertical-align: top;
}

.block-body [style*="margin-left:-141.75pt"] {
    margin-left: 0 !important;
}

.block-body p.dlModulbegrenzung0 {
    display: none !important;
}

.block-body p.dlTabellezusammenhalten {
    margin: 0 !important;
}

/* Drucklayout */
@page {
    size: A4 portrait;
    margin: 18mm 16mm 20mm 24mm;
}

@media print {
    body {
        padding: 0;
        background: var(--hb-white);
    }

    .toolbar {
        margin: 0 0 10mm;
        border-radius: 0;
    }

    .toolbar-actions {
        display: none !important;
    }

    .print-wrapper {
        max-width: none;
        margin: 0;
    }

    .print-block {
        margin-bottom: 6mm;
        padding-bottom: 0;
        border-bottom: 0;
        page-break-inside: auto;
    }

    .hb-headline-block,
    .hb-figure-block,
    .block-body table,
    .block-body figure,
    .block-body .warning,
    .block-body .achtung,
    .block-body .hinweis,
    .block-body .note,
    .block-body .info {
        page-break-inside: avoid;
        break-inside: avoid;
    }

    .block-body p {
        orphans: 2;
        widows: 2;
    }
}

/* Responsive Vorschau */
@media screen and (max-width: 900px) {
    body {
        padding: 8px;
    }

    .toolbar {
        align-items: flex-start;
        flex-direction: column;
        margin: -8px -8px 12px;
    }

    .print-wrapper {
        max-width: 100%;
    }
}