/*
 * Compact template — dense single column, smaller type scale, sans-serif.
 * Shared by browser (edit) and mPDF (pdf). No flexbox, no CSS grid:
 * floats / tables / block layout only, so the two renderers agree.
 * Skills render as a two-column list via fixed-width floats.
 */

/* ---- page margins (multi-page) ---------------------------------------- *
 * PdfService gives mPDF margin_* = 0, so a PDF's only vertical margin is
 * this wrapper's own padding — and a wrapper's padding-top lands on page 1
 * alone, leaving every later page hard against the sheet edge.
 *
 * @page restores an identical margin on every page; `@page :first` zeroes
 * the top one so page 1 keeps using the wrapper padding it always had and
 * its output is unchanged. Left/right stay 0 — the wrapper's horizontal
 * padding already applies to every page. Inert in the browser (@page is
 * print-only), and builder.js reads these same values back out of CSSOM
 * so its page-count model matches what mPDF actually does. */
@page {
    margin: 30px 0 30px 0;
}
@page :first {
    margin-top: 0;
}

.resume-page.resume-compact {
    width: 794px;               /* A4 @ 96dpi -> fills A4 width in mPDF */
    box-sizing: border-box;
    padding: 30px 40px;
    background: #ffffff;
    color: #1a1a1a;
    font-family: 'DejaVu Sans', Helvetica, Arial, sans-serif;
    font-size: 11.5px;
    line-height: 1.35;
}

/* mPDF does NOT inherit font-family/size into table cells — anything inside
   a <td> silently falls back to the serif document default (in-td trap class,
   2026-07 slate rework). This template's row/column/band layout uses tables,
   so the font must be declared at td level too. No-op in the browser. */
.resume-compact td {
    font-family: 'DejaVu Sans', Helvetica, Arial, sans-serif;
    font-size: 11.5px;
    line-height: 1.35;
    color: #1a1a1a;
}


/* ---- header ------------------------------------------------------------ */
.cv-header {
    border-bottom: 1px solid #1a1a1a;
    padding-bottom: 8px;
    margin-bottom: 10px;
}
.cv-name {
    font-size: 22px;
    font-weight: bold;
    letter-spacing: 0.2px;
    margin: 0 0 2px;
    line-height: 1.1;
}
.cv-jobtitle {
    font-size: 12px;
    color: #444;
    margin-bottom: 4px;
}
.cv-contact {
    font-size: 10.5px;
    color: #333;
}
.cv-contact span {
    margin-right: 3px;
}

/* ---- sections: thin rule between every section -------------------------- */
.cv-section {
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid #ddd;
}
.cv-section-title {
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #1a1a1a;
    margin: 0 0 4px;
    page-break-after: avoid;
}
/* page-break-after:avoid on the title alone is not reliable in mPDF — a
 * header can still land as the last line on a page with its first entry
 * pushed to the next one. Wrapping the title together with its first entry
 * in a page-break-inside:avoid group moves the pair to the next page as a
 * unit. */
.cv-section-head-group {
    page-break-inside: avoid;
}
.cv-summary {
    text-align: left;
}

/* ---- items --------------------------------------------------------------- */
.cv-item {
    position: relative;
    margin-bottom: 6px;
    page-break-inside: avoid;
}
.cv-item:last-child {
    margin-bottom: 0;
}

/* Two-column "title left / dates right" via table (mPDF-safe). */
.cv-row {
    width: 100%;
    border-collapse: collapse;
}
.cv-row td {
    vertical-align: top;
    padding: 0;
}
.cv-row-main {
    text-align: left;
}
.resume-compact .cv-row-side {
    text-align: right;
    white-space: nowrap;
    width: 28%;
    color: #444;
    font-size: 10.5px;
}
.cv-item-title {
    font-weight: bold;
}
.cv-item-org {
    font-style: italic;
    color: #333;
}
.cv-item-sep {
    color: #333;
    font-style: normal;
}
.cv-item-loc {
    font-style: italic;
}
.cv-dates {
    font-weight: bold;
}
.cv-item-details {
    margin-top: 2px;
}

/* Bullets */
.cv-bullets {
    margin: 3px 0 0;
    padding-left: 16px;
}
.cv-bullets li {
    margin-bottom: 1px;
    position: relative;
}

/* ---- skills: two-column float list (mPDF-safe fixed-width floats) -------
 * mPDF's float-wrap math doesn't reliably split 50%-width floats into two
 * columns (percentage widths, and even fixed widths summing to exactly the
 * container width, both collapse to a single column). A fixed px width with
 * real slack below half the .resume-page content width (794 - 2*40 = 714px)
 * is required: 320px + 20px margin = 340px per column, 680px for both,
 * comfortably under 714px. Verified against mPDF directly. */
.cv-skills-cols {
    overflow: hidden; /* browser-only clearfix; .cv-clear handles mPDF */
}
.cv-skill-col-item {
    position: relative;
    float: left;
    width: 320px;
    margin-right: 20px;
    margin-bottom: 2px;
}
.cv-skill-bullet {
    color: #999;
    margin-right: 3px;
}
.cv-clear {
    clear: both;
}

/* Languages / certs */
.cv-inline-item {
    position: relative;
    margin-bottom: 2px;
    page-break-inside: avoid;
}
.cv-item-side {
    float: right;
    color: #444;
    font-size: 10.5px;
}
.cv-muted {
    color: #777;
}

/* =====================================================================
 * Edit-mode affordances (browser only — these elements are never
 * emitted in pdf mode, so none of this reaches mPDF).
 * ===================================================================== */

/* contenteditable placeholders */
[contenteditable][data-ph]:empty:before {
    content: attr(data-ph);
    color: #b7b7b7;
    font-style: italic;
    pointer-events: none;
}
[contenteditable] {
    outline: none;
    border-radius: 2px;
    transition: box-shadow 0.12s ease, background 0.12s ease;
}
[contenteditable]:hover {
    box-shadow: 0 0 0 1px #d6e2ff;
}
[contenteditable]:focus {
    box-shadow: 0 0 0 2px #2563eb;
    background: #f5f9ff;
}
.cv-contact [contenteditable] {
    display: inline-block;
    min-width: 30px;
}

/* add / remove / reorder controls */
.edit-controls {
    position: absolute;
    top: -2px;
    right: -40px;
    opacity: 0;
    transition: opacity 0.12s ease;
    white-space: nowrap;
    z-index: 5;
}
.edit-controls--inline {
    position: absolute;
    left: -24px;
    right: auto;
    top: 0;
}
.cv-skill-col-item .edit-controls--inline {
    left: auto;
    right: 6px;
}
.cv-item:hover > .edit-controls,
.cv-inline-item:hover > .edit-controls,
.cv-skill-col-item:hover > .edit-controls,
.cv-bullets li:hover > .edit-controls,
.edit-controls:hover {
    opacity: 1;
}
.edit-controls button {
    font-family: inherit;
    font-size: 11px;
    line-height: 1;
    width: 17px;
    height: 17px;
    margin-left: 2px;
    padding: 0;
    border: 1px solid #ccc;
    background: #fff;
    color: #444;
    border-radius: 3px;
    cursor: pointer;
}
.edit-controls button:hover {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.cv-add {
    font-family: inherit;
    font-size: 11px;
    margin-top: 4px;
    padding: 3px 8px;
    border: 1px dashed #b7c4e0;
    background: #fff;
    color: #2563eb;
    border-radius: 4px;
    cursor: pointer;
}
.cv-add:hover {
    background: #f5f9ff;
    border-color: #2563eb;
}
.cv-add--sm {
    font-size: 10px;
    padding: 2px 6px;
}

.cv-current {
    display: block;
    font-family: inherit;
    font-size: 9.5px;
    font-weight: normal;
    color: #777;
    margin-top: 1px;
    white-space: nowrap;
    cursor: pointer;
}
.cv-current input {
    vertical-align: middle;
}
