:root {
    --primary-color: #005691;
    --secondary-color: #475569;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --bg-light: #f8fafc;
    --border-color: #e2e8f0;
    --accent-blue: #0ea5e9;
    --doc-font-size: 1.115385rem;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: small;
    min-width: 350px;
    max-width: 1000px;
    margin: 0 auto;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-dark);
    background-color: #f1f5f9;
    line-height: 1.5;
    padding: 30px 20px;
    transition: all 0.3s ease;
}

.document-container {
    max-width: 100%;
    margin: 0 auto;
    background: #ffffff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 40px;
}

/* Header Setup */
.header {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 15px;
    margin-bottom: 25px;
}

.profile-container {
    flex-grow: 1;
    flex-shrink: 1;
    flex-basis: 75%;
    max-width: max-content;
    margin-right: 10px;
}

.profile-name {
    font-size: 2.15rem;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.profile-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
}

.contact-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 15px 25px;
    font-size: var(--doc-font-size);
    color: var(--text-light);
}

.contact-grid span strong {
    color: var(--text-dark);
}

.contact-grid a {
    color: var(--primary-color);
    text-decoration: none;
}

.contact-grid a:hover {
    color: var(--accent-blue);
    text-decoration: underline;
}

/* Section Layouts */
.main-section {
    margin-bottom: 25px;
}

.main-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
    margin-bottom: 15px;
    letter-spacing: 0.5px;
}

.summary-block {
    background-color: var(--bg-light);
    border-left: 4px solid var(--primary-color);
    padding: 12px 15px;
    border-radius: 0 4px 4px 0;
}

.summary-text {
    font-size: var(--doc-font-size);
    color: var(--text-dark);
    text-align: justify;
}

/* Core Expertise Grid System */
.expertise-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 5px;
}

.expertise-card {
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 15px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.expertise-card-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    text-transform: uppercase;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 4px;
}

.expertise-card-content {
    font-size: var(--doc-font-size);
    color: var(--text-dark);
    line-height: 1.4;
}

/* Experience Elements */
.timeline-item {
    margin-bottom: 20px;
}

.timeline-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
    flex-wrap: wrap;
    gap: 5px;
}

.role-company {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-dark);
}

.company-name {
    color: var(--primary-color);
}

.date-location {
    font-size: var(--doc-font-size);
    color: var(--text-light);
    font-weight: 500;
}

.bullet-list {
    list-style-type: none;
    padding-left: 0;
    margin-bottom: 10px;
}

.bullet-list li {
    font-size: var(--doc-font-size);
    position: relative;
    padding-left: 15px;
    margin-bottom: 4px;
    text-align: justify;
    color: var(--text-dark);
}

.bullet-list li::before {
    content: "▶";
    /* "▣▶•"; */
    color: var(--accent-blue);
    font-weight: bold;
    position: absolute;
    left: 0;
    top: 0;
}

/* Sub Initiative Framework */
.initiatives-container {
    margin-top: 10px;
    padding-left: 15px;
    border-left: 2px solid var(--border-color);
}

.sub-initiative-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--secondary-color);
    text-transform: uppercase;
    margin-bottom: 6px;
    letter-spacing: 0.3px;
}

.project-item {
    font-size: var(--doc-font-size);
    margin-bottom: 6px;
    text-align: justify;
    color: var(--text-dark);
}

.project-item strong {
    color: var(--primary-color);
}

/* Education and Language */
.dual-sections {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    width: 100%;
    justify-content: space-between;
}

.dual-sections :last-child {
    flex: 0 0 max-content;
}

.dual-sections :first-child {
    flex-grow: 1;
    flex-shrink: 1;
    flex-basis: 65%;
    max-width: max-content;
}

.edu-table {
    width: 100%;
    border-collapse: collapse;
    font-size: var(--doc-font-size);
}

.edu-table th,
.edu-table td {
    text-align: left;
    padding: 4px;
    border-bottom: 1px solid var(--border-color);
}

.edu-table th {
    color: var(--secondary-color);
    font-weight: 700;
}

.lang-level {
    font-weight: 600;
    color: var(--primary-color);
}

/* Generic */
span.nbr {
    white-space: nowrap;
}

.screen-only {
    display: block;
}

.print-only {
    display: none;
}


/* Dynamic Print Optimization */
@media print {
    @page {
        size: A4;
    }

    html {
        font-size: 9pt;
    }

    body {
        background-color: #ffffff;
        padding: 0;
    }

    .summary-block {
        background-color: transparent;
        border-left: none;
        padding: 0;
    }

    .document-container {
        box-shadow: none;
        padding: 0;
        border-radius: 0;
    }

    .header {
        margin-bottom: 15px;
        padding-bottom: 10px;
    }

    .profile-name {
        font-size: 18pt;
        /* 24px; */
    }

    .profile-title {
        font-size: 11pt;
        /* 14px; */
        margin-bottom: 10px;
    }

    .main-section {
        margin-bottom: 15px;
    }

    .main-section-title {
        font-size: 11pt;
        margin-bottom: 8px;
        padding-bottom: 2px;
    }

    .summary-text,
    .bullet-list li,
    .project-item {
        font-size: 9pt !important;
        line-height: 1.35;
    }

    /* Revert cards style to clean printable blocks without box backgrounds */
    .expertise-grid {
        display: block;
    }

    .expertise-card {
        background: none !important;
        border: none !important;
        padding: 0 !important;
        box-shadow: none !important;
        page-break-inside: avoid;
        margin-bottom: 8px;
    }

    .expertise-card-title {
        font-size: 9.4pt !important;
        margin-bottom: 2px !important;
        border-bottom: none !important;
        padding-bottom: 0 !important;
        display: inline-block;
        width: 180px;
        vertical-align: top;
    }

    .expertise-card-content {
        font-size: 9pt !important;
        display: inline-block;
        width: calc(100% - 185px);
        vertical-align: top;
    }

    /* Prevent Unintended Section Page-Break Splitting */
    .timeline-item {
        margin-bottom: 12px;
        page-break-inside: avoid;
    }

    .initiatives-container {
        margin-top: 5px;
        border-left: 1px solid var(--border-color);
    }

    .main-section {
        page-break-inside: auto;
    }

    h2.main-section-title {
        page-break-after: avoid;
    }

    .screen-only {
        display: none;
    }

    .print-only {
        display: block;
    }
}