/* Classic Resume CSS */

:root {
    --primary-color: #333;
    --accent-color: #2c3e50;
    --bg-color: #fff;
    --font-serif: 'Merriweather', serif;
    --font-sans: 'Open Sans', sans-serif;
    --page-width: 210mm;
    --page-height: 297mm;
    --page-padding: 40px 50px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    background: #555;
    /* Outside page background */
    font-family: var(--font-serif);
    color: #333;
    line-height: 1.6;
    font-size: 14px;
    /* Use flex to center the preview-container */
    display: flex;
    justify-content: center;
    min-height: 100vh;
}

/* 
   CSS Pagination Layout
   This container effectively acts as the "document".
   By setting column-width equal to page width and column-gap to 0 (or a gap),
   content flows horizontally into new "pages". 
*/
#resume-container {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #555;
    /* match body bg */
    padding-bottom: 50px;
    height: auto;
    /* Allow growth */
    overflow: visible;
}

.page {
    background: var(--bg-color);
    width: var(--page-width);
    height: var(--page-height);
    padding: var(--page-padding);
    margin-top: 30px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
    /* start hidden, maybe visible for debug */
}

/* Print overrides handled separately */

/* Page Break Controls */
h1,
h2,
h3,
h4,
h5,
h6 {
    break-after: avoid;
    page-break-after: avoid;
    break-inside: avoid;
}

.resume-section {
    break-inside: avoid;
    /* Try to keep sections together */
    page-break-inside: avoid;
    margin-bottom: 25px;
}

/* Exception: Allow breaking inside long lists if needed, but headers stay attached */
.resume-section .item {
    break-inside: avoid;
}

/* Typography & Layout */
.resume-header {
    border-bottom: 3px solid #000;
    padding-bottom: 20px;
    margin-bottom: 25px;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.name {
    font-family: var(--font-sans);
    font-size: 2.5rem;
    font-weight: 700;
    text-transform: uppercase;
    margin: 0;
    line-height: 1.2;
}

.job-title {
    font-family: var(--font-sans);
    font-size: 1.1rem;
    color: #666;
    margin: 5px 0 15px 0;
    font-weight: 600;
}

.contact-info {
    font-family: var(--font-sans);
    font-size: 0.9rem;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.profile-photo {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 5px;
    /* Square/rounded for classic */
    border: 1px solid #ddd;
}

h3 {
    font-family: var(--font-sans);
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    border-bottom: 2px solid #000;
    padding-bottom: 5px;
    padding-bottom: 5px;
    margin-top: 20px;
    margin-bottom: 15px;
}

.item-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
}

.item-title {
    font-weight: 800;
    display: block;
    font-size: 1.05rem;
}

.item-subtitle {
    font-style: italic;
    color: #555;
    display: block;
}

.item-date {
    font-weight: 600;
    min-width: 100px;
    text-align: right;
}

.item-meta {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 5px;
}

.skills-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.skills-list span {
    font-weight: 600;
    border-bottom: 1px solid #ddd;
}

.item-desc {
    white-space: pre-wrap;
}

/* Print Overrides */
@media print {
    body {
        margin: 0;
        padding: 0;
        background: white;
    }

    #resume-container {
        width: 100%;
        margin: 0;
        padding: 0;
        background: white;
    }

    .page {
        margin: 0;
        box-shadow: none;
        page-break-after: always;
        break-after: page;
        height: auto;
        /* OR keep 297mm if strict */
        min-height: 297mm;
    }

    /* Remove last page break if needed, or handle in JS */
    .page:last-child {
        page-break-after: auto;
        break-after: auto;
    }
}