/*
 * Classic template — single column, serif.
 * Shared by browser (edit) and mPDF (pdf). No flexbox, no CSS grid:
 * floats / tables / block layout only, so the two renderers agree.
 */

/* ---- page margins (multi-page) ---------------------------------------- *
 * PdfService gives mPDF margin_* = 0, so the ONLY vertical margin a PDF gets
 * is .resume-page's own padding — and a wrapper's padding-top lands on page 1
 * alone. Every later page therefore started hard against the sheet edge
 * (measured: page 1 text top 9.2%, page 2 top 1.2% / bottom 98.2%).
 *
 * @page restores an identical margin on every page; `@page :first` zeroes the
 * top one so page 1 keeps using the wrapper padding it always has, leaving
 * existing page-1 output byte-for-byte unchanged. Left/right stay 0 because
 * the wrapper's horizontal padding already applies to every page.
 * Inert in the browser — @page only ever applies to print. */
@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: #1a1a1a;
    font-family: 'DejaVu Serif', Georgia, "Times New Roman", Times, serif;
    font-size: 14px;
    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-classic td {
    font-family: 'DejaVu Serif', Georgia, "Times New Roman", Times, serif;
    font-size: 14px;
    line-height: 1.45;
    color: #1a1a1a;
}


/* ---- header ---------------------------------------------------------- */
.cv-header {
    text-align: center;
    border-bottom: 2px solid #1a1a1a;
    padding-bottom: 14px;
    margin-bottom: 18px;
}
.cv-photo-wrap {
    margin-bottom: 10px;
}
.cv-photo,
.cv-photo-initials {
    margin: 0 auto;
}
.cv-name {
    font-size: 30px;
    font-weight: bold;
    letter-spacing: 0.5px;
    margin: 0 0 4px;
    line-height: 1.1;
}
.cv-jobtitle {
    font-size: 15px;
    font-style: italic;
    color: #444;
    margin-bottom: 8px;
}
.cv-contact {
    font-size: 12.5px;
    color: #333;
}
.cv-contact span {
    margin: 0 4px;
}

/* ---- sections -------------------------------------------------------- */
.cv-section {
    margin-bottom: 16px;
}
.cv-section:last-child {
    margin-bottom: 0;
}
/* pdf mode: mPDF doesn't reliably honor :last-child, so the server marks
 * whichever section/item actually renders last with this plain class
 * instead (classic.php). Unscoped on purpose — it 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: 14px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    border-bottom: 1px solid #999;
    padding-bottom: 3px;
    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. */
.cv-section-head-group {
    page-break-inside: avoid;
}
.cv-summary {
    text-align: left;
}

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

/* 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-classic .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 {
    font-style: italic;
    color: #333;
}
.cv-item-sep {
    color: #333;
    font-style: normal;
}
.cv-item-loc {
    font-style: italic;
}
.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 / languages / certs */
.cv-skills-line {
    line-height: 1.6;
}
.cv-inline-item {
    position: relative;
    margin-bottom: 3px;
    page-break-inside: avoid;
}
.cv-item-side {
    float: right;
    color: #444;
    font-size: 12.5px;
}
.cv-muted {
    color: #777;
}

/* Skill/language level dots (tpl_dots) */
.cv-level {
    font-size: 10px;
    letter-spacing: 1px;
    margin-left: 4px;
}
.cv-dot-on {
    color: #2563eb;
}
.cv-dot-off {
    color: #d1d5db;
}

.cv-taglist {
    line-height: 2;
}
.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 */
[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;
}

/* Level dot editor (skills/languages) */
.cv-level {
    white-space: nowrap;
}
.cv-dot-btn {
    font-family: inherit;
    font-size: 10px;
    line-height: 1;
    width: 12px;
    height: 12px;
    padding: 0;
    margin: 0 1px;
    border: none;
    background: none;
    cursor: pointer;
}
.cv-level-toggle {
    font-family: inherit;
    font-size: 9px;
    line-height: 1;
    padding: 1px 3px;
    margin-left: 3px;
    border: 1px solid #ccc;
    background: #fff;
    color: #777;
    border-radius: 2px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.12s ease;
}
.cv-tag:hover .cv-level-toggle,
.cv-inline-item:hover .cv-level-toggle {
    opacity: 1;
}
.cv-level-text {
    display: inline-block;
    min-width: 20px;
}
