/* resume.css — Patrick Bourke
   Mobile-first, with desktop and print overrides */

:root {
    --text:    #1a1a1a;
    --muted:   #555;
    --accent:  #1a56a0;
    --border:  #d8d8d8;
    --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
            'Helvetica Neue', Arial, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

/* ── Base / Mobile ────────────────────────────────── */

body {
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.55;
    color: var(--text);
    background: #f0f0f0;
    margin: 0;
    padding: 0;
}

#page {
    background: #fff;
    padding: 1.5rem;
    max-width: 860px;
    margin: 0 auto;
}

/* Header */

header {
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--accent);
}

h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0 0 0.15rem;
    line-height: 1.1;
}

.tagline {
    color: var(--muted);
    margin: 0;
    font-size: 0.9rem;
}

address {
    font-style: normal;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem 1.5rem;
    margin-top: 0.75rem;
}

address a {
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
}

address a:hover { text-decoration: underline; }

/* Section headings */

section { margin-bottom: 1.75rem; }

h2 {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin: 0 0 0.75rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--border);
}

/* Summary */

.summary {
    margin: 0;
    font-size: 0.95rem;
}

/* Skills */

.skills {
    margin: 0;
    padding-left: 1.5rem;
    list-style: disc;
}

.skills li {
    margin-bottom: 0.35rem;
    font-size: 0.92rem;
}

/* Jobs */

.job {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid #eee;
}

.job:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.job-head {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.company {
    font-weight: 700;
    font-size: 1rem;
}

.company a {
    color: var(--text);
    text-decoration: none;
}

.company a:hover { color: var(--accent); }

.meta {
    color: var(--muted);
    font-size: 0.88rem;
}

.title {
    font-style: italic;
    font-size: 0.93rem;
    margin: 0.1rem 0 0.4rem;
}

.job ul {
    margin: 0.3rem 0 0;
    padding-left: 1.5rem;
    list-style: disc;
}

.job li {
    margin-bottom: 0.25rem;
    font-size: 0.92rem;
}

/* Education */

.edu { margin-bottom: 0.75rem; }

.edu-head {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.school {
    font-weight: 700;
    font-size: 1rem;
}

.degree {
    font-style: italic;
    font-size: 0.93rem;
    display: block;
    margin: 0.1rem 0 0;
}

/* Publications */

.pubs {
    margin: 0;
    padding-left: 1.5rem;
    list-style: disc;
}

.pubs li {
    margin-bottom: 0.6rem;
    font-size: 0.92rem;
}

/* ── Desktop ──────────────────────────────────────── */

@media (min-width: 640px) {
    body { padding: 1.5rem; }

    #page {
        padding: 2.5rem 3rem;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    }

    header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
    }

    address {
        flex-direction: column;
        align-items: flex-end;
        gap: 0.25rem;
        margin-top: 0.2rem;
    }

    .job-head, .edu-head {
        flex-direction: row;
        justify-content: space-between;
        align-items: baseline;
        gap: 1rem;
    }

    .meta { white-space: nowrap; }

    .skills {
        columns: 2;
        column-gap: 2rem;
    }

    .skills li { break-inside: avoid; }

    h1 { font-size: 2rem; }
}

/* ── Print ────────────────────────────────────────── */

@media print {
    body {
        background: white;
        padding: 0;
        font-size: 10pt;
        line-height: 1.45;
    }

    @page {
        margin: 0.4in 0.5in;
    }

    @page :first {
        margin-top: 0.3in;
    }

    #page {
        max-width: none;
        margin: 0;
        padding: 0;
        box-shadow: none;
    }

    a { color: inherit; text-decoration: none; }
    .pdf-link { display: none; }

    /* Header: compact, side-by-side */
    header {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        padding-bottom: 0.5rem;
        margin-bottom: 0.75rem;
    }

    h1 { font-size: 1.6rem; }

    address {
        flex-direction: column;
        align-items: flex-end;
        gap: 0.15rem;
        margin-top: 0;
    }

    /* Section headings: no visible border (use box-shadow instead
       to avoid artifacts with the ::after orphan guard) */
    h2 {
        color: var(--accent);
        border-bottom: none;
        box-shadow: 0 1px 0 #ccc;
        margin-bottom: 0.5rem;
        padding-bottom: 0.2rem;
        break-after: avoid;
    }

    /* Orphan guard for Firefox (which ignores break-after).
       Creates an invisible block extending below the h2 —
       if the page can't fit this block, it pushes the h2
       to the next page along with its content. */
    h2::after {
        content: "";
        display: block;
        height: 6rem;
        margin-bottom: -6rem;
    }

    /* Tighter spacing */
    section { margin-bottom: 1rem; }

    .job {
        margin-bottom: 0.7rem;
        padding-bottom: 0.7rem;
        border-bottom-color: #eee;
    }

    .job li { margin-bottom: 0.1rem; }

    .meta { white-space: nowrap; }

    .job-head, .edu-head {
        flex-direction: row;
        justify-content: space-between;
        align-items: baseline;
        gap: 1rem;
    }

    /* Skills: 2-column in print too */
    .skills {
        columns: 2;
        column-gap: 1.5rem;
    }

    .skills li { break-inside: avoid; }

    /* Keep blocks together where possible */
    .job, .edu { break-inside: avoid; }
    header { break-after: avoid; }
}
