/* ============================================
   Company Profile Viewer — Base Stylesheet
   A4 Landscape: 297mm × 210mm
   ============================================ */

/* ---- CSS Variables ---- */
:root {
    --brand: #0b3a5b;
    --brand-light: #1e5a8a;
    --brand-2: #0f766e;
    --brand-2-light: #2dd4bf;
    --accent: #c7a24b;
    --accent-light: #f2c86b;
    --accent-dark: #8b6f2a;
    --ink: #1a1a2e;
    --ink-soft: #475569;
    --paper: #ffffff;
    --paper-warm: #fdfbf7;
    --paper-cool: #f8fafc;
    --line: #e2e8f0;
    --line-soft: #f1f5f9;
    --serif: 'Georgia', 'Times New Roman', serif;
    --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;
}

/* ---- Reset ---- */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { font-size: 16px; }

body {
    font-family: var(--sans);
    background: #2a2a3a;
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ---- Viewer Chrome (screen only) ---- */
.viewer-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 56px;
    background: #1a1a2e;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}

.viewer-header .vh-brand {
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.viewer-header .vh-brand img {
    height: 28px;
    filter: brightness(0) invert(1);
}

.viewer-header .vh-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.viewer-header .vh-controls button {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    padding: 7px 14px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.viewer-header .vh-controls button:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.3);
}

.viewer-header .vh-controls button.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 600;
}

.viewer-header .vh-controls button.primary:hover {
    background: var(--accent-dark);
}

.viewer-header .vh-nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.viewer-header .vh-nav button {
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.7);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.viewer-header .vh-nav button:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.viewer-header .vh-nav button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.viewer-header .vh-page-num {
    font-size: 13px;
    color: rgba(255,255,255,0.6);
    min-width: 60px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* ---- Sidebar (screen only) ---- */
.viewer-sidebar {
    position: fixed;
    top: 56px;
    left: 0;
    bottom: 0;
    width: 240px;
    background: #1e1e30;
    overflow-y: auto;
    padding: 16px 0;
    z-index: 999;
    transition: transform 0.3s ease;
}

.viewer-sidebar.collapsed {
    transform: translateX(-240px);
}

.viewer-sidebar .vs-section {
    padding: 8px 16px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.4);
    font-weight: 600;
    margin-top: 12px;
}

.viewer-sidebar .vs-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    color: rgba(255,255,255,0.7);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    border-left: 3px solid transparent;
}

.viewer-sidebar .vs-item:hover {
    background: rgba(255,255,255,0.05);
    color: #fff;
}

.viewer-sidebar .vs-item.active {
    background: rgba(199,162,75,0.1);
    color: var(--accent-light);
    border-left-color: var(--accent);
}

.viewer-sidebar .vs-item .vs-num {
    font-size: 11px;
    color: rgba(255,255,255,0.3);
    font-variant-numeric: tabular-nums;
    min-width: 20px;
}

.viewer-sidebar .vs-item.active .vs-num {
    color: var(--accent);
}

/* ---- Page Container ---- */
.viewer-main {
    margin-top: 56px;
    margin-left: 240px;
    padding: 32px;
    transition: margin-left 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 32px;
}

.viewer-main.sidebar-collapsed {
    margin-left: 0;
}

/* ---- A4 Page ---- */
.a4-page {
    width: 297mm;
    min-height: 210mm;
    background: var(--paper);
    box-shadow: 0 4px 24px rgba(0,0,0,0.15);
    position: relative;
    overflow: hidden;
    page-break-after: always;
    break-after: page;
}

/* ---- Shared page elements ---- */
.page-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20mm;
    font-size: 9px;
    color: rgba(0,0,0,0.35);
    border-top: 1px solid var(--line-soft);
}

.page-footer .pf-brand {
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.page-footer .pf-num {
    font-variant-numeric: tabular-nums;
}

/* ---- Utility ---- */
.serif { font-family: var(--serif); }
.mono { font-family: var(--mono); }

/* ---- Print ---- */
@media print {
    @page {
        size: A4 landscape;
        margin: 0;
    }

    body {
        background: #fff;
    }

    .viewer-header,
    .viewer-sidebar {
        display: none !important;
    }

    .viewer-main {
        margin: 0 !important;
        padding: 0 !important;
        gap: 0 !important;
    }

    .a4-page {
        box-shadow: none !important;
        width: 297mm !important;
        min-height: 210mm !important;
        page-break-after: always !important;
        break-after: page !important;
    }

    .a4-page:last-child {
        page-break-after: auto !important;
        break-after: auto !important;
    }
}

/* ---- Screen scaling for fit ---- */
@media screen and (max-width: 1400px) {
    .viewer-main {
        transform: scale(0.85);
        transform-origin: top center;
    }
}

@media screen and (max-width: 1100px) {
    .viewer-main {
        transform: scale(0.65);
        transform-origin: top center;
    }
}
