/*
 * Toolbox template — certifications-forward, built for trades and manufacturing.
 * Large legible type (14.5px, 1.55 line-height), pure black on white for printing.
 * No flexbox, no CSS grid: floats / tables / block layout only, for mPDF.
 */

/* ---- 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 56px;
    background: #ffffff;
    color: #000000;
    font-family: 'DejaVu Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
    font-size: 14.5px;
    line-height: 1.55;
}

/* 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-toolbox td {
    font-family: 'DejaVu Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
    font-size: 14.5px;
    line-height: 1.55;
    color: #000000;
}


/* ---- header ---------------------------------------------------------- */
.cv-header {
    text-align: left;
    margin-bottom: 18px;
}
.cv-name {
    font-size: 24px;
    font-weight: bold;
    margin: 0 0 6px;
    line-height: 1.1;
}
.cv-contact {
    font-size: 13px;
    color: #000000;
    margin-bottom: 6px;
}
.cv-contact span {
    margin-right: 8px;
}

/* ---- certifications strip ---------------------------------------------- */
.cv-certs-strip {
    border: 1px solid #111827;
    background: #f3f4f6;
    padding: 12px 14px;
    margin-bottom: 18px;
    line-height: 1.5;
    font-size: 14.5px;
    page-break-inside: avoid;
}
.cv-cert-item {
    display: inline;
}
/* Edit-mode-only wrappers. Alpine's x-if renders exactly ONE root element, so
   the issuer/date/pipe run is wrapped in these; they must stay `display:inline`
   or the strip would break onto its own line in the builder while the export
   (which emits the spans directly, no wrapper) stayed on one line. */
.cv-cert-meta,
.cv-cert-datewrap {
    display: inline;
}
.cv-cert-name {
    font-weight: bold;
}
.cv-cert-issuer {
    font-style: italic;
}
.cv-cert-sep {
    margin: 0 2px;
}
.cv-cert-pipe {
    margin: 0 6px;
    color: #666;
}

/* mPDF doesn't honor :last-child for margin purposes (cvg-template skill
 * §5) — the section/entry that will actually render last gets an explicit
 * server-added .is-last class instead (toolbox.php). Unscoped on purpose —
 * applies to whichever element carries it (section, item, or inline-item). */
/* 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;
}

/* ---- sections -------------------------------------------------------- */
.cv-section {
    margin-bottom: 18px;
}
.cv-section-title {
    font-size: 14.5px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid #000000;
    padding-bottom: 6px;
    margin: 0 0 12px;
    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 ----------------------------------------------------------- */
/* Inter-item spacing is margin-TOP (not margin-bottom), added only via the
 * two sibling-combinator rules below rather than as a base property on
 * .cv-item itself. Both points matter:
 *   - margin-BOTTOM on a repeated page-break-inside:avoid block accumulates
 *     a double-counted reserve in mPDF — confirmed directly (7+ .cv-item
 *     entries each carrying their own margin-bottom forced a genuine blank
 *     trailing page even though all real content fit on the preceding
 *     pages; margin-top on the same elements did not reproduce it).
 *   - A *conditional override* of a margin-top set as .cv-item's own base
 *     value (tried both as a `.cv-section-head-group .cv-item` descendant
 *     selector and as an explicit server-added class, mirroring the
 *     .is-last technique used elsewhere in this file) reintroduced the same
 *     blank page every time, for any item nested inside another avoid block
 *     (.cv-section-head-group) — mPDF's avoid-block estimator resolves the
 *     cascade differently for its height estimate than for the real paint
 *     once two avoid blocks are nested with a margin override between them.
 *     Declaring margin-top only through additive combinator selectors (no
 *     competing values for the same selector at all) sidesteps that: the
 *     first item in each section — nested in .cv-section-head-group — never
 *     matches either combinator, so it naturally gets zero top margin
 *     without needing an override.
 */
.cv-item {
    position: relative;
    page-break-inside: avoid;
}
.cv-section-head-group + .cv-item,
.cv-item + .cv-item {
    margin-top: 14px;
}

/* Experience: company bold, then position + location line with dates right */
.cv-company {
    font-weight: bold;
    margin-bottom: 2px;
}
.cv-row {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 4px;
}
.cv-row td {
    vertical-align: top;
    padding: 0;
}
.cv-row-main {
    text-align: left;
}
.cv-row-side {
    text-align: right;
    white-space: nowrap;
    width: 30%;
}
.cv-item-title {
    font-weight: bold;
}
.cv-item-loc {
    margin-left: 6px;
    font-style: italic;
}
.cv-dates {
    font-weight: bold;
    white-space: nowrap;
}
.cv-dates-line {
    font-weight: bold;
    margin-bottom: 2px;
}

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

/* Skills / languages */
.cv-skills-line {
    line-height: 1.55;
}
.cv-inline-item {
    position: relative;
    margin-bottom: 4px;
    page-break-inside: avoid;
}
.cv-item-details {
    margin-top: 4px;
}
.cv-muted {
    color: #333;
}

.cv-taglist {
    line-height: 1.8;
}
.cv-tag {
    display: inline-block;
    margin: 0 8px 4px 0;
    padding: 3px 8px;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
}

.cv-item-field {
    display: block;
    margin-top: 1px;
}

/* =====================================================================
 * 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: 40px;
}

/* add / remove / reorder controls */
.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,
.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 #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: 12.5px;
    margin-top: 6px;
    padding: 4px 10px;
    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: 11.5px;
    padding: 2px 8px;
}

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

.cv-tag {
    position: relative;
}
.cv-tag-x {
    font-family: inherit;
    border: none;
    background: none;
    color: #b00;
    cursor: pointer;
    padding: 0 0 0 4px;
    opacity: 0;
    font-size: 13px;
}
.cv-tag:hover .cv-tag-x {
    opacity: 1;
}
