/* ===== CV Page – A4 Print-Ready Layout ===== */

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 10pt;
    line-height: 1.45;
    color: #1a1a1a;
    background: #e5e7eb;
    -webkit-font-smoothing: antialiased;
}

/* ---------- A4 Page Container ---------- */
.page-wrapper {
    display: flex;
    justify-content: center;
    padding: 32px 16px;
    min-height: 100vh;
}

.a4-page {
    width: 210mm;
    min-height: 297mm;
    background: #ffffff;
    padding: 18mm 20mm 16mm 20mm;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
    position: relative;
    display: flex;
    flex-direction: column;
}

/* ---------- Header ---------- */
.cv-header {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding-bottom: 14px;
    border-bottom: 2px solid #2563eb;
    margin-bottom: 14px;
}

.header-photo {
    flex-shrink: 0;
    width: 90px;
    height: 90px;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid #e5e7eb;
}

.header-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.header-info {
    flex: 1;
    min-width: 0;
}

.cv-name {
    font-size: 20pt;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 6px;
}

.cv-meta {
    font-size: 9pt;
    color: #4b5563;
    line-height: 1.7;
}

.cv-meta span:first-child {
    font-weight: 600;
    color: #374151;
}

.header-lang {
    flex-shrink: 0;
    display: flex;
    align-items: flex-start;
}

.header-lang nav {
    display: flex;
    gap: 6px;
}

.lang-link {
    display: inline-block;
    padding: 3px 10px;
    font-size: 8pt;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    transition: all 0.15s ease;
    cursor: pointer;
}

.lang-link:hover {
    color: #2563eb;
    border-color: #2563eb;
}

.lang-link.active {
    color: #ffffff;
    background: #2563eb;
    border-color: #2563eb;
}

/* ---------- Sections ---------- */
.cv-section {
    margin-bottom: 12px;
}

.cv-section-title {
    font-size: 11pt;
    font-weight: 700;
    color: #2563eb;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding-bottom: 4px;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 8px;
}

.cv-text {
    font-size: 9.5pt;
    color: #374151;
    line-height: 1.55;
}

/* ---------- Education ---------- */
.cv-edu-item {
    margin-bottom: 6px;
}

.cv-edu-main {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.cv-edu-degree {
    font-size: 9.5pt;
    font-weight: 600;
    color: #111827;
}

.cv-edu-period {
    font-size: 8.5pt;
    color: #6b7280;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: 12px;
}

.cv-edu-sub {
    display: flex;
    justify-content: space-between;
    font-size: 9pt;
    color: #4b5563;
}

/* ---------- Skills ---------- */
.cv-skill-row {
    display: flex;
    align-items: baseline;
    margin-bottom: 3px;
    font-size: 9.5pt;
}

.cv-skill-cat {
    font-weight: 600;
    color: #111827;
    min-width: 110px;
    flex-shrink: 0;
}

.cv-skill-cat::after {
    content: ':';
    margin-right: 8px;
}

.cv-skill-items {
    color: #374151;
}

/* ---------- Languages ---------- */
.cv-lang-row {
    display: inline-flex;
    align-items: baseline;
    margin-right: 24px;
    margin-bottom: 3px;
    font-size: 9.5pt;
}

.cv-lang-name {
    font-weight: 600;
    color: #111827;
}

.cv-lang-name::after {
    content: ' – ';
    font-weight: 400;
    color: #6b7280;
}

.cv-lang-level {
    color: #4b5563;
}

/* ---------- Projects ---------- */
.cv-project-item {
    margin-bottom: 6px;
}

.cv-project-main {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.cv-project-name {
    font-size: 9.5pt;
    font-weight: 600;
    color: #111827;
}

.cv-project-tech {
    font-size: 8.5pt;
    color: #6b7280;
    white-space: nowrap;
    flex-shrink: 0;
    margin-left: 12px;
}

.cv-project-desc {
    font-size: 9pt;
    color: #4b5563;
}

/* ---------- Print Date Footer ---------- */
.cv-print-date {
    margin-top: auto;
    padding-top: 10px;
    text-align: right;
    font-size: 7.5pt;
    color: #9ca3af;
}

/* ========== Print Styles ========== */
@page {
    size: A4;
    margin: 0;
}

@media print {
    body {
        background: #ffffff;
    }

    .page-wrapper {
        padding: 0;
        min-height: auto;
    }

    .a4-page {
        width: 210mm;
        min-height: 297mm;
        box-shadow: none;
        padding: 18mm 20mm 16mm 20mm;
    }

    /* Hide language switcher when printing */
    .header-lang {
        display: none;
    }

    /* Prevent page breaks inside sections */
    .cv-section {
        break-inside: avoid;
    }

    .cv-edu-item,
    .cv-project-item {
        break-inside: avoid;
    }
}

/* ========== Responsive – small screens ========== */
@media screen and (max-width: 800px) {
    .page-wrapper {
        padding: 16px 8px;
    }

    .a4-page {
        width: 100%;
        min-height: auto;
        padding: 24px 20px 20px 20px;
    }
}
