/*
 * Advocate template — assertive serif layout, outcome-first structure.
 * Shared by browser (edit) and mPDF (pdf). No flexbox, no CSS grid:
 * floats / tables / block layout only, so the two renderers agree.
 *
 * Experience entries display position before company (see advocate.php) —
 * that's a markup-order swap only, both spans keep the same classes as
 * every other template so the CSS below stays identical in spirit.
 *
 * The first bullet of each experience gets semibold emphasis. This relies
 * on :first-child, plus a server-rendered `.cv-bullet-first` fallback class
 * for pdf mode (see advocate.php) in case mPDF's :first-child support ever
 * regresses — both selectors are targeted below.
 */

/* ---- 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.resume-advocate {
    width: 794px;              /* A4 @ 96dpi -> fills A4 width in mPDF */
    box-sizing: border-box;
    padding: 48px 56px;
    background: #ffffff;
    color: #1a1a1a;
    font-family: 'DejaVu Serif', Georgia, "Times New Roman", Times, serif;
    font-size: 14px;
    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-advocate td {
    font-family: 'DejaVu Serif', Georgia, "Times New Roman", Times, serif;
    font-size: 14px;
    line-height: 1.5;
    color: #1a1a1a;
}


/* ---- header ---------------------------------------------------------- */
.resume-advocate .cv-header {
    margin-bottom: 20px;
}
.resume-advocate .cv-name {
    font-size: 28px;
    font-weight: bold;
    margin: 0 0 8px;
    line-height: 1.1;
}
.resume-advocate .cv-name-rule {
    width: 60px;
    height: 4px;
    background-color: #7f1d1d;
    margin-bottom: 10px;
}
.resume-advocate .cv-jobtitle {
    font-size: 15px;
    font-style: italic;
    color: #444;
    margin-bottom: 8px;
}
.resume-advocate .cv-contact {
    font-size: 12.5px;
    color: #333;
}
.resume-advocate .cv-contact span {
    margin: 0 4px;
}

/* ---- sections ----------------------------------------------------------
 * Section headers are small-caps and accent-colored — assertive, not loud.
 * ------------------------------------------------------------------- */
.resume-advocate .cv-section {
    margin-bottom: 16px;
}
.resume-advocate .cv-section-title {
    font-size: 14px;
    font-weight: bold;
    font-variant: small-caps;
    letter-spacing: 1px;
    border-bottom: 1px solid #999;
    padding-bottom: 3px;
    margin: 0 0 8px;
    color: #7f1d1d; /* overridden inline per-resume accentColor */
    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. */
.resume-advocate .cv-section-head-group {
    page-break-inside: avoid;
}

/* Summary reads as an opening statement — bold weight, not just quoted. */
.resume-advocate .cv-summary {
    text-align: left;
}
.resume-advocate .cv-summary--statement {
    font-weight: bold;
    font-size: 15px;
}

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

/* Two-column "title left / dates right" via table (mPDF-safe). */
.resume-advocate .cv-row {
    width: 100%;
    border-collapse: collapse;
}
.resume-advocate .cv-row td {
    vertical-align: top;
    padding: 0;
}
.resume-advocate .cv-row-main {
    text-align: left;
}
.resume-advocate .cv-row-side {
    text-align: right;
    white-space: nowrap;
    width: 30%;
    color: #444;
    font-size: 12.5px;
}

/* Outcome-first inversion: position leads, bold 15px; company follows in
 * regular weight. Markup order is swapped in advocate.php, not these rules. */
.resume-advocate .cv-item-title {
    font-weight: bold;
    font-size: 15px;
}
.resume-advocate .cv-item-org {
    font-weight: normal;
    font-style: italic;
    color: #333;
}
.resume-advocate .cv-item-sep {
    color: #333;
    font-style: normal;
}
.resume-advocate .cv-item-loc {
    font-style: italic;
}
.resume-advocate .cv-dates {
    font-weight: bold;
}
.resume-advocate .cv-item-details {
    margin-top: 3px;
}

/* Bullets — first bullet of each experience is emphasized (semibold). */
.resume-advocate .cv-bullets {
    margin: 5px 0 0;
    padding-left: 20px;
}
.resume-advocate .cv-bullets li {
    margin-bottom: 2px;
    position: relative;
}
.resume-advocate .cv-bullets li:first-child,
.resume-advocate .cv-bullets li:nth-child(1),
.resume-advocate .cv-bullets li.cv-bullet-first {
    font-weight: bold;
}

/* Skills / languages / certs */
.resume-advocate .cv-skills-line {
    line-height: 1.6;
}
.resume-advocate .cv-inline-item {
    position: relative;
    margin-bottom: 3px;
    page-break-inside: avoid;
}
.resume-advocate .cv-item-side {
    float: right;
    color: #444;
    font-size: 12.5px;
}
.resume-advocate .cv-muted {
    color: #777;
}

.resume-advocate .cv-taglist {
    line-height: 2;
}
.resume-advocate .cv-tag {
    display: inline-block;
    margin: 0 6px 4px 0;
    padding: 2px 6px;
    background: #f2f2f2;
    border-radius: 3px;
}

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

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

/* add / remove / reorder controls */
.resume-advocate .edit-controls {
    position: absolute;
    top: -2px;
    right: -44px;
    opacity: 0;
    transition: opacity 0.12s ease;
    white-space: nowrap;
    z-index: 5;
}
.resume-advocate .edit-controls--inline {
    position: absolute;
    left: -26px;
    right: auto;
    top: 0;
}
.resume-advocate .cv-item:hover > .edit-controls,
.resume-advocate .cv-inline-item:hover > .edit-controls,
.resume-advocate .cv-bullets li:hover > .edit-controls,
.resume-advocate .edit-controls:hover {
    opacity: 1;
}
.resume-advocate .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;
}
.resume-advocate .edit-controls button:hover {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.resume-advocate .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;
}
.resume-advocate .cv-add:hover {
    background: #f5f9ff;
    border-color: #2563eb;
}
.resume-advocate .cv-add--sm {
    font-size: 11.5px;
    padding: 2px 8px;
}

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

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