/*
 * Greenfield template — airy single column, 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 inline-block pill tags (mPDF-safe: inline-block wraps
 * across lines like text, no flex/grid needed). Bullets use a thin en-dash
 * marker rendered as literal markup with a hanging indent (a CSS ::before
 * marker never renders under 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: 52px 0 52px 0;
}
@page :first {
    margin-top: 0;
}

.resume-page {
    width: 794px;              /* A4 @ 96dpi -> fills A4 width in mPDF */
    box-sizing: border-box;
    padding: 52px 60px;
    background: #ffffff;
    color: #1f2430;
    font-family: 'DejaVu Sans', Helvetica, Arial, sans-serif;
    font-size: 13.5px;
    line-height: 1.6;
}

/* 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-greenfield td {
    font-family: 'DejaVu Sans', Helvetica, Arial, sans-serif;
    font-size: 13.5px;
    line-height: 1.6;
    color: #1f2430;
}


/* ---- header ---------------------------------------------------------- */
.cv-header {
    margin-bottom: 28px;
}
.cv-name {
    font-size: 24px;
    font-weight: normal;
    margin: 0 0 4px;
    line-height: 1.2;
    color: #1f2430;
}
.cv-jobtitle {
    font-size: 15px;
    font-weight: normal;
    margin-bottom: 10px;
}
.cv-contact {
    font-size: 12.5px;
    color: #6b7280;
}
.cv-contact span {
    margin-right: 12px;
}

/* ---- sections -------------------------------------------------------- */
.cv-section {
    margin-bottom: 28px;
}
.cv-section:last-child {
    margin-bottom: 0;
}
/* 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 (greenfield.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;
}
.cv-section-title {
    font-size: 12.5px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #6b7280;
    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 ------------------------------------------------------------- */
.cv-item {
    position: relative;
    page-break-inside: avoid;
}
/* Inter-item spacing is margin-TOP via additive sibling selectors, never
   margin-bottom: margin-bottom on a repeated page-break-inside:avoid block
   double-counts in mPDF's pagination-height estimate and opens a blank
   trailing page (cvg-template skill §5, toolbox bug class). The first item
   in a section naturally matches neither selector — no zeroing override,
   which would reintroduce the blank page. */
.cv-section-head-group + .cv-item,
.cv-item + .cv-item {
    margin-top: 18px;
}

/* 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-greenfield .cv-row-side {
    text-align: right;
    white-space: nowrap;
    width: 32%;
    color: #6b7280;
    font-size: 12.5px;
}
.cv-item-title {
    font-weight: bold;
}
.cv-item-org {
    color: #374151;
}
.cv-item-sep {
    color: #9ca3af;
}
.cv-item-loc {
    color: #6b7280;
}
.cv-dates {
    font-weight: bold;
    color: #4b5563;
}
.cv-item-details {
    margin-top: 4px;
    color: #374151;
}

/* Bullets — thin en-dash marker, absolutely positioned. */
.cv-bullets {
    list-style: none;
    margin: 8px 0 0;
    padding: 0;
}
.cv-bullets li {
    margin-bottom: 4px;
    padding-left: 16px;
}
.cv-bullet-marker {
    display: inline-block;
    width: 16px;
    margin-left: -16px;
    color: #059669;
}

/* Skills — pill tags. display:inline-block wraps like text across lines,
   both in the browser and in mPDF (no flex/grid needed for wrapping). */
.cv-pills {
    line-height: 2.2;
}
.cv-pill {
    display: inline-block;
    margin: 0 6px 6px 0;
    padding: 2px 10px;
    border: 1px solid #d1d5db;
    border-radius: 12px;
    color: #1f2430;
}

/* Languages / certifications — same margin-top-only rule as .cv-item. */
.cv-inline-item {
    position: relative;
    page-break-inside: avoid;
}
.cv-section-head-group + .cv-inline-item,
.cv-inline-item + .cv-inline-item {
    margin-top: 6px;
}
.cv-item-side {
    float: right;
    color: #6b7280;
    font-size: 12.5px;
}
.cv-muted {
    color: #9ca3af;
}

/* =====================================================================
 * 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: #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 #a7f3d0;
}
[contenteditable]:focus {
    box-shadow: 0 0 0 2px #059669;
    background: #f0fdf4;
}
.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,
.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: #059669;
    border-color: #059669;
    color: #fff;
}

.cv-add {
    font-family: inherit;
    font-size: 12.5px;
    margin-top: 6px;
    padding: 4px 10px;
    border: 1px dashed #a7f3d0;
    background: #fff;
    color: #059669;
    border-radius: 4px;
    cursor: pointer;
}
.cv-add:hover {
    background: #f0fdf4;
    border-color: #059669;
}
.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-pill {
    position: relative;
}
.cv-pill-x {
    font-family: inherit;
    border: none;
    background: none;
    color: #b00;
    cursor: pointer;
    padding: 0 0 0 4px;
    opacity: 0;
    font-size: 13px;
}
.cv-pill:hover .cv-pill-x {
    opacity: 1;
}
