/*
 * Chalkboard template — full-width deep-green header band, single column.
 * Shared by browser (edit) and mPDF (pdf). No flexbox, no CSS grid: floats,
 * tables, and block layout only, so the two renderers agree.
 */

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

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

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


/* ---- header band (full width, deep green, 88px tall) -------------------- */
.cv-header-band {
    box-sizing: border-box;
    width: 100%;
    height: 88px;
    padding: 0 56px;
    background: #14532d;
    color: #ffffff;
    /* Browser-only nicety: mPDF ignores border-radius on block elements and
       renders a plain rectangle instead — accepted divergence from print. */
    border-radius: 4px 4px 0 0;
}
.cv-header-table {
    width: 100%;
    height: 88px;
    border-collapse: collapse;
}
.cv-header-table td {
    vertical-align: middle;
    padding: 0;
}
.cv-header-main {
    text-align: left;
}
.cv-header-side {
    text-align: right;
    width: 320px;
}
.cv-header-band .cv-name {
    font-size: 26px;
    font-weight: bold;
    letter-spacing: 0.3px;
    margin: 0;
    line-height: 1.1;
    color: #ffffff;
}
.cv-header-band .cv-jobtitle {
    font-size: 13px;
    margin-top: 4px;
    color: rgba(255, 255, 255, 0.8);
}
.cv-header-band .cv-contact {
    font-size: 11.5px;
    color: rgba(255, 255, 255, 0.9);
    text-align: right;
}
.cv-header-band .cv-contact span {
    margin-left: 4px;
}

/* ---- body ---------------------------------------------------------------- */
/* Bottom padding is 0 on purpose (the pulse/sapphire/trajectory rule): trailing
   wrapper padding is real space in the browser's flow — and so in the height
   the builder measures — but mPDF does not open a page to hold padding that
   carries no content, so it silently disappears from the export. The two
   renderers then disagree by exactly that padding: measured here at 1091px
   against a 1083px page-1 capacity, i.e. the editor reported two pages for a
   one-page export. The bottom gap on every page comes from @page's
   margin-bottom (40px, top of this file) instead, which does not add to the
   flow. This template read as clean until 2026-09-02 only because the
   main.css heading leak was under-measuring by a similar amount in the
   opposite direction — two bugs cancelling, not one template working. */
.cv-body {
    padding: 30px 56px 0;
}

.cv-section {
    margin-bottom: 16px;
}
.cv-section-title {
    font-size: 14px;
    font-weight: bold;
    color: #14532d;
    margin: 0 0 10px;
    padding-bottom: 8px;
    border-bottom: 3px solid #14532d;
    /* Underline only spans 24px, not the full section width. */
    width: 24px;
    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). */
.cv-section-head-group + .cv-item,
.cv-item + .cv-item {
    margin-top: 12px;
}

/* 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-chalkboard .cv-row-side {
    text-align: right;
    white-space: nowrap;
    width: 30%;
    color: #444;
    font-size: 12.5px;
}
.cv-item-title {
    font-weight: bold;
}
.cv-item-org {
    color: #333;
}
.cv-item-sep {
    color: #333;
}
.cv-item-loc {
    color: #555;
}
.cv-dates {
    font-weight: bold;
}
.cv-item-details {
    margin-top: 3px;
}

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

/* ---- skills: two-column float list with check-style markers ------------- */
.cv-skill-list {
    list-style: none;
    margin: 0;
    padding: 0;
    /* Clearfix via overflow is grid/flex-free and mPDF-safe. */
    overflow: hidden;
}
.cv-skill-list li {
    float: left;
    width: 50%;
    box-sizing: border-box;
    padding: 2px 10px 2px 18px;
    position: relative;
}
.cv-skill-marker {
    display: inline-block;
    width: 18px;
    margin-left: -18px;
    color: #14532d;
    font-weight: bold;
    text-align: center;
}

/* pdf-mode skills grid: a real table replaces the float list (repeated
   same-direction floats stack into one column in mPDF). Marker geometry
   comes from a literal space in the markup, not inline-block width, which
   mPDF drops inside a <td>. */
.cv-skill-grid {
    width: 100%;
    border-collapse: collapse;
}
.cv-skill-cell {
    width: 50%;
    padding: 2px 10px 2px 0;
    vertical-align: top;
}
.cv-skill-cell .cv-skill-marker {
    display: inline;
    width: auto;
    margin-left: 0;
}

/* 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: 3px;
}
.cv-item-side {
    float: right;
    color: #444;
    font-size: 12.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;
}
.cv-header-band [contenteditable][data-ph]:empty:before {
    color: rgba(255, 255, 255, 0.7);
}
[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-header-band [contenteditable]:hover {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6);
}
.cv-header-band [contenteditable]:focus {
    box-shadow: 0 0 0 2px #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

/* 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: #14532d;
    border-color: #14532d;
    color: #fff;
}

.cv-add {
    font-family: inherit;
    font-size: 12.5px;
    margin-top: 6px;
    padding: 4px 10px;
    border: 1px dashed #a9c9b3;
    background: #fff;
    color: #14532d;
    border-radius: 4px;
    cursor: pointer;
}
.cv-add:hover {
    background: #f0f7f2;
    border-color: #14532d;
}
.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;
}
