/*
 * Brief template — legal-brief structure, numbered sections, hanging indents.
 * Shared by browser (edit) and mPDF (pdf). No flexbox, no CSS grid:
 * floats / tables / block layout only, so the two renderers agree.
 * Monochrome by design — no accent color is used anywhere in this template.
 */

/* ---- 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-brief {
    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;
}

/* ---- header ---------------------------------------------------------- */
.resume-brief .cv-header {
    text-align: center;
    margin-bottom: 20px;
}
.resume-brief .cv-name {
    font-size: 22px;
    font-weight: bold;
    font-variant: small-caps;
    letter-spacing: 1px;
    margin: 0 0 4px;
    line-height: 1.1;
}
.resume-brief .cv-jobtitle {
    font-size: 14px;
    font-style: italic;
    color: #333;
    margin-bottom: 6px;
}
.resume-brief .cv-contact {
    font-size: 12.5px;
    color: #333;
}
.resume-brief .cv-contact span {
    margin: 0 4px;
}

/* Double rule: two 1px lines, 3px apart, built from a single bordered box. */
.resume-brief .cv-header-rule {
    height: 3px;
    margin-top: 12px;
    border-top: 1px solid #1a1a1a;
    border-bottom: 1px solid #1a1a1a;
}

/* ---- sections ---------------------------------------------------------
 * Section titles are flush left and never indented. Roman numerals are
 * literal PHP-generated markup (see brief.php) — always plain text here.
 * ------------------------------------------------------------------- */
.resume-brief .cv-section {
    margin-bottom: 16px;
}
/* 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 (brief.php). Unscoped on purpose —
 * applies to whichever element carries it (section, entry, or
 * inline-item). */
.resume-brief .is-last {
    margin-bottom: 0;
}
.resume-brief .cv-section-title {
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 8px;
    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-brief .cv-section-head-group {
    page-break-inside: avoid;
}
.resume-brief .cv-summary {
    text-align: left;
}

/* Section body content (non-entry sections) picks up the same hanging
 * indent as entries, so the whole document reads on one consistent grid. */
.resume-brief .cv-section-body {
    padding-left: 24px;
}

/* ---- entries (experience / education) ----------------------------------
 * Hanging indent: header flush left, body indented 24px via padding on a
 * wrapper block (no text-indent tricks — mPDF handles padding reliably).
 * ------------------------------------------------------------------- */
.resume-brief .cv-entry {
    position: relative;
    page-break-inside: avoid;
}
/* Inter-entry 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 entry
   in a section naturally matches neither selector — no zeroing override. */
.resume-brief .cv-section-head-group + .cv-entry,
.resume-brief .cv-entry + .cv-entry {
    margin-top: 12px;
}
.resume-brief .cv-entry-head {
    text-align: left;
}
.resume-brief .cv-entry-title {
    font-weight: bold;
}
.resume-brief .cv-entry-org {
    font-style: italic;
    color: #333;
}
.resume-brief .cv-entry-sep {
    color: #333;
    font-style: normal;
}
.resume-brief .cv-entry-dates {
    color: #333;
    margin-left: 4px;
}
.resume-brief .cv-entry-loc {
    font-style: italic;
    color: #333;
}
.resume-brief .cv-entry-details {
    margin-top: 3px;
}
.resume-brief .cv-entry-body {
    padding-left: 24px;
    margin-top: 3px;
    text-align: left;
}

/* Bullets sit inside the indented body — extra padding is relative to it. */
.resume-brief .cv-bullets {
    margin: 5px 0 0;
    padding-left: 18px;
    text-align: left;
}
.resume-brief .cv-bullets li {
    margin-bottom: 2px;
    position: relative;
}

/* Skills / languages / certs */
.resume-brief .cv-skills-line {
    line-height: 1.6;
}
/* Same margin-top-only rule as .cv-entry (repeated avoid-block trap). */
.resume-brief .cv-inline-item {
    position: relative;
    page-break-inside: avoid;
}
.resume-brief .cv-section-head-group + .cv-inline-item,
.resume-brief .cv-inline-item + .cv-inline-item {
    margin-top: 3px;
}
.resume-brief .cv-muted {
    color: #666;
}

.resume-brief .cv-taglist {
    line-height: 2;
}
.resume-brief .cv-tag {
    display: inline-block;
    margin: 0 6px 4px 0;
    padding: 2px 6px;
    background: #f2f2f2;
    border: 1px solid #ccc;
}

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

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

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

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

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

.resume-brief .cv-tag {
    position: relative;
}
.resume-brief .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-brief .cv-tag:hover .cv-tag-x {
    opacity: 1;
}
