/*
 * Host template — warm, approachable single column.
 * Shared by browser (edit) and mPDF (pdf). No flexbox, no CSS grid:
 * floats / tables / block layout only, so the two renderers agree.
 *
 * Font stack leads with 'DejaVu Sans', not Verdana. mPDF has no Verdana and
 * substituted DejaVu Sans CONDENSED for it (the §5 in-td trap), while the
 * browser — where Verdana IS installed — honoured the pin. So the canvas
 * showed Verdana and every export came out in a narrower Condensed face:
 * measured at 143 of 143 matched text runs differing. Verdana stays in the
 * stack behind it as a no-fonts-loaded fallback.
 */

/* ---- 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: 48px 0 48px 0;
}
@page :first {
    margin-top: 0;
}

.resume-page {
    width: 794px;              /* A4 @ 96dpi -> fills A4 width in mPDF */
    box-sizing: border-box;
    padding: 48px 52px;
    background: #ffffff;
    color: #2d2d2d;
    font-family: 'DejaVu Sans', Verdana, Arial, sans-serif;
    font-size: 13px;
    line-height: 1.5;
}

/* 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-host td {
    font-family: 'DejaVu Sans', Verdana, Arial, sans-serif;
    font-size: 13px;
    line-height: 1.5;
    color: #2d2d2d;
}


/* ---- header ---------------------------------------------------------- */
.cv-header {
    margin-bottom: 24px;
}
.cv-name {
    font-size: 28px;
    font-weight: bold;
    margin: 0 0 6px;
    line-height: 1.1;
    color: #2d2d2d;
    letter-spacing: -0.5px;
}
.cv-jobtitle {
    font-size: 14px;
    font-weight: normal;
    color: #c2410c;
    margin-bottom: 10px;
}
.cv-contact {
    font-size: 12px;
    color: #555;
    line-height: 1.4;
}
.cv-contact span {
    margin: 0 1px;
}

/* ---- sections -------------------------------------------------------- */
.cv-section {
    margin-bottom: 20px;
}
/* pdf mode: mPDF doesn't reliably honor :last-child, so the server marks
 * whichever section/item actually renders last with this plain class
 * instead (host.php). Unscoped on purpose. */
/* DO NOT raise this selector's specificity. It ties .cv-section /
   .cv-inline-item at (0,1,0) and wins only on source order — but scoping it to
   .resume-X, or class-doubling it, also makes it override the margin on
   page-break-inside:avoid entries, which reintroduces the blank trailing page
   it exists to prevent (measured on classic, metric, ledger, sapphire,
   curriculum, host; skill §5 avoid-estimator trap). */
.is-last {
    margin-bottom: 0;
}
.cv-section-title {
    font-size: 15px;
    font-weight: normal;
    letter-spacing: 0.06em;
    margin: 0 0 12px;
    padding-bottom: 0;
    border-bottom: none;
    color: #2d2d2d;
    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 {
    font-size: 15px;
    line-height: 1.65;
    color: #333;
}

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

.cv-row {
    width: 100%;
    border-collapse: collapse;
}
.cv-row td {
    vertical-align: top;
    padding: 0;
}
.cv-row-main {
    text-align: left;
}
.resume-host .cv-row-side {
    text-align: right;
    white-space: nowrap;
    width: 28%;
    color: #666;
    font-size: 12px;
}
.cv-item-title {
    font-weight: bold;
    color: #2d2d2d;
}
.cv-item-org {
    font-weight: normal;
    color: #555;
}
.cv-item-sep {
    font-weight: normal;
    color: #999;
}
.cv-item-loc {
    font-size: 12px;
    color: #666;
}
.cv-dates {
    font-weight: bold;
    color: #555;
}
.cv-item-details {
    margin-top: 4px;
    font-size: 12.5px;
    color: #444;
}

/* Bullets */
.cv-bullets {
    margin: 6px 0 0;
    padding-left: 18px;
}
.cv-bullets li {
    margin-bottom: 3px;
    position: relative;
    font-size: 13px;
}

/* Two-column lists for skills and languages (edit mode: CSS multicol). mPDF
 * doesn't support `columns` at all — it silently collapses to one stacked
 * column (cvg-template skill §5) — so pdf mode renders these two sections as
 * a real `<table class="cv-grid-table">` grid instead (host.php). */
.cv-twocol-list {
    display: block;
    columns: 2;
    column-gap: 24px;
}
.cv-list-item {
    position: relative;
    margin-bottom: 8px;
    break-inside: avoid;
    page-break-inside: avoid;
}
.cv-item-side {
    float: right;
    color: #666;
    font-size: 12px;
    margin-left: 8px;
}
.cv-muted {
    color: #999;
}

/* pdf mode: table-based grid (mPDF-safe replacement for the multicol list above). */
.cv-grid-table {
    width: 100%;
    border-collapse: collapse;
}
.cv-grid-table td {
    vertical-align: top;
    padding: 0;
}
.resume-host .cv-list-cell {
    width: 50%;
    box-sizing: border-box;
    padding: 0 12px 8px 0;
    font-size: 13px;
}

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

[contenteditable][data-ph]:empty:before {
    content: attr(data-ph);
    color: #c2b5a8;
    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 #e8d4c4;
}
[contenteditable]:focus {
    box-shadow: 0 0 0 2px #c2410c;
    background: #fff9f5;
}
.cv-contact [contenteditable] {
    display: inline-block;
    min-width: 40px;
}

.edit-controls {
    position: absolute;
    top: -2px;
    right: -44px;
    opacity: 0;
    transition: opacity 0.12s ease;
    white-space: nowrap;
    z-index: 5;
}
.edit-controls--inline {
    position: absolute;
    left: -26px;
    right: auto;
    top: 0;
}
.cv-item:hover > .edit-controls,
.cv-inline-item:hover > .edit-controls,
.cv-bullets li:hover > .edit-controls,
.cv-list-item:hover > .cv-item-remove,
.edit-controls:hover {
    opacity: 1;
}
.edit-controls button {
    font-family: inherit;
    font-size: 13px;
    line-height: 1;
    width: 20px;
    height: 20px;
    margin-left: 2px;
    padding: 0;
    border: 1px solid #d9ccc2;
    background: #fff;
    color: #666;
    border-radius: 3px;
    cursor: pointer;
}
.edit-controls button:hover {
    background: #c2410c;
    border-color: #c2410c;
    color: #fff;
}

.cv-item-remove {
    position: absolute;
    font-family: inherit;
    font-size: 13px;
    line-height: 1;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 1px solid #d9ccc2;
    background: #fff;
    color: #666;
    border-radius: 3px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.12s ease;
    margin-left: 4px;
}
.cv-item-remove:hover {
    background: #c2410c;
    border-color: #c2410c;
    color: #fff;
}

.cv-add {
    font-family: inherit;
    font-size: 12.5px;
    margin-top: 8px;
    padding: 4px 10px;
    border: 1px dashed #d9ccc2;
    background: #fff;
    color: #c2410c;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.12s ease;
}
.cv-add:hover {
    background: #fff9f5;
    border-color: #c2410c;
}
.cv-add--sm {
    font-size: 11.5px;
    padding: 2px 8px;
}

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