/**
 * reader.css
 *
 * Styling für die Reader-Ansicht indexierter 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-dark: #111827;
    --hb-dark-soft: #1f2937;
    --hb-text: #111827;
    --hb-muted: #6b7280;
    --hb-border: #e5e7eb;
    --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 {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
    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);
}

/* Kopfleiste */
.topbar {
    flex-shrink: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    background: var(--hb-dark);
    color: #f9fafb;
    border-bottom: 1px solid var(--hb-dark-soft);
}

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

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

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

.topbar-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

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

.topbar-links {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.topbar a {
    color: #e5e7eb;
    font-size: 12px;
    text-decoration: none;
}

.topbar a:hover {
    text-decoration: underline;
}

/* Layout */
.layout {
    flex: 1;
    display: flex;
    min-height: 0;
}

/* Inhaltsverzeichnis */
.sidebar {
    width: 260px;
    max-width: 100%;
    padding: 14px 12px;
    overflow-y: auto;
    background: var(--hb-dark);
    color: #e5e7eb;
    border-right: 1px solid var(--hb-dark-soft);
}

.sidebar h2 {
    margin: 0 0 8px;
    color: #9ca3af;
    font-size: 13px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.sidebar ul {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 13px;
}

.sidebar li {
    margin-bottom: 4px;
}

.sidebar a {
    display: block;
    padding: 4px 6px;
    border-radius: 6px;
    color: #e5e7eb;
    line-height: 1.3;
    text-decoration: none;
}

.sidebar a:hover {
    background: var(--hb-dark-soft);
}

.sidebar a.active {
    background: var(--hb-red);
    color: var(--hb-white);
}

/* Inhalt */
.content {
    flex: 1;
    overflow-y: auto;
    padding: 24px 18px 32px;
}

.content-inner {
    max-width: 980px;
    margin: 0 auto;
    padding: 28px 32px 30px;
    background: var(--hb-white);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
}

.page-body {
    color: var(--hb-text);
    font-size: 14px;
    line-height: 1.6;
    overflow-wrap: break-word;
}

.page-body p,
.page-body h1,
.page-body h2,
.page-body h3,
.page-body h4,
.page-body ul,
.page-body ol,
.page-body table {
    max-width: 72ch;
}

.page-body img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* Importierte Tabellen */
.page-body table {
    width: 100% !important;
    margin-left: 0 !important;
    border-collapse: collapse;
    table-layout: auto !important;
}

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

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

.page-body table[style*="background-color:#DDDDDD"],
.page-body td[style*="background-color:#DDDDDD"] {
    border-color: #d1d5db;
}

/* DocuGlobe-Leerartefakte */
.page-body p.dlModulbegrenzung0 {
    display: none !important;
}

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

/* Seitennavigation */
.page-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: 22px;
}

.page-nav .btn {
    display: inline-block;
    padding: 7px 12px;
    border-radius: 999px;
    background: var(--hb-dark);
    color: #f9fafb;
    font-size: 12px;
    text-decoration: none;
    white-space: nowrap;
}

.page-nav .btn:hover {
    background: #374151;
}

.page-nav .btn.is-disabled {
    opacity: 0.4;
    pointer-events: none;
}

.page-nav-center {
    flex: 1;
    color: var(--hb-muted);
    font-size: 12px;
    text-align: center;
}

/* Tablet */
@media (max-width: 900px) {
    .topbar {
        flex-wrap: wrap;
    }

    .layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        max-height: 220px;
        border-right: none;
        border-bottom: 1px solid var(--hb-dark-soft);
    }

    .content {
        padding: 16px 10px 24px;
    }

    .content-inner {
        padding: 18px 16px 20px;
        border-radius: 12px;
    }
}

/* Smartphone */
@media (max-width: 640px) {
    .topbar {
        padding: 10px 12px;
    }

    .topbar-left {
        align-items: flex-start;
    }

    .topbar-logo {
        height: 24px;
    }

    .topbar-title {
        font-size: 14px;
    }

    .topbar-meta,
    .topbar a,
    .page-nav-center,
    .page-nav .btn {
        font-size: 11px;
    }

    .page-nav {
        flex-direction: column;
        align-items: stretch;
    }

    .page-nav-center {
        order: -1;
    }

    .page-nav .btn {
        width: 100%;
        text-align: center;
    }
}

/* Große Bildschirme */
@media (min-width: 1400px) {
    .content-inner {
        max-width: 1100px;
    }
}