/* ============================================================
   CV - print-optimized 2-page A4 layout
   Each .cv-page is exactly one A4 sheet so the 2-column grid
   never splits across pages (browsers don't paginate grids
   reliably). A forced page-break separates the two sheets.
   ============================================================ */

:root {
    --cv-accent: #f08973;
    --cv-dark:   #27282c;
    --cv-bar:    #2c2c2c;
    --cv-body:   #54595f;
    --cv-muted:  #8a8d96;
    --cv-line:   #ececec;
    --cv-soft:   #f5f5f6;
    --cv-page-w: 210mm;
    --cv-page-h: 297mm;
    --cv-pad-x:  12mm;
    --cv-pad-y:  10mm;
}

body.cv-body {
    background: #e9eaee;
    color: var(--cv-dark);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    overflow-x: hidden;
}

/* ===== Action bar (download / back) ===== */
.cv-actions {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 100;
    display: flex;
    gap: 10px;
}
.cv-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 12px 18px;
    border-radius: 999px;
    border: 2px solid var(--cv-dark);
    background: #fff;
    color: var(--cv-dark);
    cursor: pointer;
    text-decoration: none;
    transition: all .25s ease;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}
.cv-action:hover {
    border-color: var(--cv-accent);
    color: var(--cv-accent);
    transform: translateY(-2px);
}
.cv-action--primary {
    background: var(--cv-accent);
    border-color: var(--cv-accent);
    color: #fff;
}
.cv-action--primary:hover {
    background: #fff;
    color: var(--cv-accent);
    border-color: var(--cv-accent);
}
.cv-action i { font-size: 14px; }

/* ===== Paper page (one per A4 sheet) ===== */
.cv-page {
    width: var(--cv-page-w);
    height: var(--cv-page-h);
    margin: 24px auto;
    background: #fff;
    color: var(--cv-dark);
    font-family: 'Montserrat', sans-serif;
    font-size: 10pt;
    line-height: 1.55;
    box-shadow: 0 10px 40px rgba(0,0,0,0.12);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ===== Page 1 header (slim contact bar, then portrait + identity row) ===== */
.cv-header {
    flex-shrink: 0;
    margin-bottom: 7mm;
    position: relative;
}
.cv-header-bar {
    background: var(--cv-bar);
    padding: 3mm 12mm;
    overflow: hidden;
}
.cv-header-contact {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 6mm;
    font-size: 7.8pt;
    color: rgba(255,255,255,.94);
    line-height: 1.2;
}
.cv-header-contact li {
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}
.cv-header-contact i {
    color: var(--cv-accent);
    font-size: 9pt;
    flex-shrink: 0;
    width: 11px;
    height: 11px;
}
.cv-header-contact a { color: inherit; text-decoration: none; }
.cv-header-contact a:hover { color: var(--cv-accent); }

.cv-header-meta {
    display: flex;
    align-items: center;
    gap: 6mm;
    padding: 9mm 12mm 8mm;
    border-bottom: 1px solid var(--cv-line);
    position: relative;
}
.cv-header-meta::after {
    content: "";
    position: absolute;
    left: 12mm;
    bottom: -2px;
    width: 24mm;
    height: 3px;
    background: var(--cv-accent);
    border-radius: 2px;
}
.cv-header-portrait {
    flex-shrink: 0;
    display: block;
    width: 27mm;
    height: 27mm;
    overflow: hidden;
    border-radius: 4px;
    background: var(--cv-soft);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
}
.cv-header-portrait img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 69% 0%;
    transform: scale(1.45);
    transform-origin: 58% 30%;
    display: block;
}
.cv-header-name {
    flex: 0 1 auto;
    min-width: 0;
    max-width: 60mm;
}
.cv-header-name h2 {
    margin: 0 0 3px;
    font-size: 18pt;
    font-weight: 800;
    color: var(--cv-dark);
    letter-spacing: -.01em;
    line-height: 1.05;
}
.cv-header-role {
    margin: 0 0 4px;
    font-size: 9.5pt;
    font-weight: 700;
    color: var(--cv-accent);
    letter-spacing: .3px;
}
.cv-header-tags {
    margin: 0;
    font-size: 9pt;
    color: var(--cv-muted);
    font-weight: 500;
    letter-spacing: .2px;
    line-height: 1.45;
}

.cv-header-results {
    flex: 1 1 auto;
    margin-left: auto;
    max-width: 92mm;
}
.cv-header-results-title {
    margin: 0 0 1.5mm;
    font-size: 6.5pt;
    font-weight: 700;
    color: var(--cv-muted);
    letter-spacing: 1.6px;
    text-transform: uppercase;
}
.cv-header-results .cv-results {
    gap: 1.8mm;
}
.cv-header-results .cv-result {
    padding: 1.8mm 2.6mm;
    gap: 0.8mm;
    border-radius: 3px;
}
.cv-header-results .cv-result-num {
    font-size: 9pt;
    line-height: 1.1;
    letter-spacing: -.3px;
}
.cv-header-results .cv-result-lbl {
    font-size: 9pt;
    line-height: 1.3;
}

/* ===== Page 2 mini header ===== */
.cv-header--mini {
    margin: 0;
    padding: 7mm var(--cv-pad-x) 4mm;
    border-bottom: 1px solid var(--cv-line);
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12mm;
}
.cv-mini-name {
    display: block;
    font-size: 11pt;
    font-weight: 800;
    color: var(--cv-dark);
    line-height: 1;
}
.cv-mini-role {
    display: block;
    font-size: 8.5pt;
    font-weight: 600;
    color: var(--cv-accent);
    margin-top: 3px;
    letter-spacing: .3px;
}
.cv-mini-meta {
    font-size: 7pt;
    font-weight: 700;
    color: var(--cv-muted);
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* ===== Body grid (per page) ===== */
.cv-grid {
    flex: 1 1 auto;
    display: grid;
    grid-template-columns: 60mm 1fr;
    gap: 12mm;
    padding: 0 var(--cv-pad-x) 3mm;
    overflow: hidden;
    min-height: 0;
}
.cv-page--continued .cv-grid {
    padding-top: 5mm;
}

/* ===== Generic block + headings ===== */
.cv-block { margin-bottom: 8mm; }
.cv-block:last-child { margin-bottom: 0; }

.cv-h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 8.5pt;
    font-weight: 800;
    color: var(--cv-accent);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin: 0 0 3mm;
    padding-bottom: 1.8mm;
    border-bottom: 1px solid var(--cv-line);
    display: flex;
    align-items: center;
    gap: 8px;
}
.cv-h3::before {
    content: "";
    width: 14px;
    height: 2px;
    background: var(--cv-accent);
    display: inline-block;
}
.cv-h3--lead {
    font-size: 10.5pt;
    letter-spacing: 2.2px;
    padding-bottom: 2.2mm;
    margin-bottom: 3.5mm;
}
.cv-h3--lead::before {
    width: 20px;
    height: 3px;
}

.cv-h4 {
    font-family: 'Montserrat', sans-serif;
    font-size: 8.5pt;
    font-weight: 800;
    color: var(--cv-dark);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 2mm;
}

/* ===== Sidebar ===== */
.cv-sidebar p {
    margin: 0;
    font-size: 9pt;
    line-height: 1.7;
    color: var(--cv-body);
}

.cv-skill-group { margin-bottom: 3mm; }
.cv-skill-group:last-child { margin-bottom: 0; }

/* ===== Value pillars (page 1 sidebar) ===== */
.cv-value-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2.6mm;
}
.cv-value-list li {
    position: relative;
    padding: 1px 0 1px 11px;
    line-height: 1.4;
}
.cv-value-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 2px;
    background: var(--cv-accent);
    border-radius: 2px;
}
.cv-value-head {
    display: block;
    font-size: 9pt;
    font-weight: 800;
    color: var(--cv-dark);
    line-height: 1.2;
    letter-spacing: .1px;
}
.cv-value-body {
    display: block;
    font-size: 8.5pt;
    color: var(--cv-muted);
    margin-top: 1.5px;
    line-height: 1.45;
    font-weight: 500;
}

.cv-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.cv-chips .chip {
    display: inline-block;
    padding: 2.5px 8px;
    background: #fff;
    border: 1px solid var(--cv-line);
    border-radius: 999px;
    font-size: 9pt;
    font-weight: 600;
    color: var(--cv-dark);
    line-height: 1.3;
}

.cv-tool-line {
    font-size: 9pt !important;
    color: var(--cv-body);
    line-height: 1.65;
}

.cv-lang-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.cv-lang-list li {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 9pt;
    padding: 2.5px 0;
    border-bottom: 1px dashed var(--cv-line);
}
.cv-lang-list li:last-child { border-bottom: 0; }
.cv-lang-list span:first-child {
    font-weight: 700;
    color: var(--cv-dark);
}
.cv-lang-level {
    color: var(--cv-muted);
    font-size: 7.5pt;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
}

.cv-cert {
    margin-bottom: 3mm;
}
.cv-cert:last-child { margin-bottom: 0; }
.cv-cert strong {
    display: block;
    font-size: 9pt;
    color: var(--cv-dark);
    font-weight: 700;
    margin-bottom: 2px;
}
.cv-cert p {
    margin: 0;
    font-size: 9pt;
    color: var(--cv-body);
    line-height: 1.65;
}
.cv-muted {
    color: var(--cv-muted);
    font-weight: 600;
    font-size: 7.5pt;
    letter-spacing: .3px;
}
.cv-muted-line {
    color: var(--cv-muted);
    font-size: 7.5pt !important;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    margin: 0 0 2px !important;
}

/* ===== Result cards ===== */
.cv-results {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3.5mm;
}
.cv-result {
    padding: 3.5mm 4.5mm;
    background: #fff;
    border: 1px solid var(--cv-line);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    gap: 1.8mm;
}
.cv-result--dark {
    background: var(--cv-bar);
    border-color: var(--cv-bar);
    color: #fff;
}
.cv-result-num {
    font-size: 14pt;
    font-weight: 800;
    color: var(--cv-accent);
    line-height: 1;
    letter-spacing: -.5px;
}
.cv-result-lbl {
    font-size: 8pt;
    line-height: 1.5;
    color: var(--cv-body);
}
.cv-result--dark .cv-result-lbl {
    color: rgba(255,255,255,0.82);
}

/* ===== Experience cards ===== */
.cv-exp {
    margin-bottom: 5.5mm;
}
.cv-exp:last-child { margin-bottom: 0; }
.cv-exp + .cv-exp {
    border-top: 1px dashed var(--cv-line);
    padding-top: 5mm;
}

.cv-exp-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 6mm;
    margin-bottom: 2mm;
}
.cv-exp-role {
    display: block;
    font-size: 10.5pt;
    font-weight: 800;
    color: var(--cv-dark);
    line-height: 1.25;
}
.cv-exp-company {
    display: block;
    font-size: 9pt;
    color: var(--cv-muted);
    font-weight: 600;
    margin-top: 2px;
}
.cv-exp-date {
    flex-shrink: 0;
    font-size: 7.5pt;
    font-weight: 700;
    color: var(--cv-accent);
    text-transform: uppercase;
    letter-spacing: .5px;
    white-space: nowrap;
    padding-top: 2px;
}
.cv-exp-summary {
    margin: 0 0 2mm;
    font-size: 9pt;
    line-height: 1.7;
    color: var(--cv-body);
}
.cv-exp-list {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 1.8mm;
}
.cv-exp-list li {
    position: relative;
    padding-left: 12px;
    font-size: 9pt;
    line-height: 1.65;
    color: var(--cv-body);
}
.cv-exp-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 7px;
    width: 6px;
    height: 2px;
    background: var(--cv-accent);
}
.cv-exp-list strong {
    color: var(--cv-dark);
    font-weight: 700;
}

.cv-exp--compact .cv-exp-summary { margin-bottom: 0; }

/* ===== Footer ===== */
.cv-footer {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 3.5mm var(--cv-pad-x) 4mm;
    border-top: 1px solid var(--cv-line);
    margin-top: auto;
    font-size: 7pt;
    font-weight: 600;
    color: var(--cv-muted);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    flex-wrap: wrap;
}
.cv-footer-accent { color: var(--cv-accent); }
.cv-footer-sep { color: var(--cv-line); }

.cv-footer--slim {
    padding: 2mm var(--cv-pad-x) 2.5mm;
    border-top: 0;
    font-size: 6.5pt;
    letter-spacing: 1.5px;
}

/* ============================================================
   Mobile / small screen - stack everything, ignore A4 sizing
   (screen-only - must not match print, which uses a narrow viewport)
   ============================================================ */
@media screen and (max-width: 880px) {
    body.cv-body { background: #fff; }
    .cv-page {
        width: 100%;
        height: auto;
        margin: 0;
        box-shadow: none;
        font-size: 11pt;
    }
    .cv-actions {
        position: sticky;
        top: 0;
        right: auto;
        background: #fff;
        margin: 0;
        padding: 12px 16px;
        border-bottom: 1px solid var(--cv-line);
        justify-content: flex-end;
    }
    .cv-header-bar {
        padding: 4mm 6mm;
    }
    .cv-header-contact {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 4mm 6mm;
        font-size: 9pt;
    }
    .cv-header-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 5mm;
        padding: 6mm 6mm;
    }
    .cv-header-portrait {
        width: 50mm;
        height: 60mm;
    }
    .cv-header-name {
        max-width: none;
        flex: 1 1 auto;
    }
    .cv-header-name h2 { font-size: 28pt; }
    .cv-header-role { font-size: 14pt; }
    .cv-header-tags { font-size: 10pt; }
    .cv-header-results {
        max-width: none;
        width: 100%;
        margin-left: 0;
    }
    .cv-header--mini {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 6mm 6mm 4mm;
    }
    .cv-grid {
        grid-template-columns: 1fr;
        gap: 6mm;
        padding: 0 6mm 6mm;
    }
    .cv-page--continued .cv-grid { padding-top: 4mm; }
    .cv-results { grid-template-columns: 1fr; }
    .cv-exp-head { flex-direction: column; gap: 2mm; }
}

/* ============================================================
   PRINT - strict 2-page A4 layout
   ============================================================ */
@page {
    size: A4;
    margin: 0;
}

@media print {
    html, body {
        background: #fff !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    body.cv-body { font-size: 9.5pt; }

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

    /* Each page block fills exactly one A4 sheet, with a forced
       page break after the first one. */
    .cv-page {
        width: 210mm;
        height: 297mm;
        margin: 0;
        box-shadow: none;
        page-break-inside: avoid;
        break-inside: avoid;
        page-break-after: always;
        break-after: page;
    }
    .cv-page:last-child {
        page-break-after: auto;
        break-after: auto;
    }

    /* Make sure colored backgrounds + dark cards print accurately */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
        color-adjust: exact !important;
    }

    a { color: inherit !important; text-decoration: none !important; }
}
