/*
 * Lumière template — split header (deep-blue photo block left, white summary +
 * contact stack right) over a single-column body.
 * Shared by browser (edit) and mPDF (pdf). No flexbox, no CSS grid, no
 * transforms: floats, tables, and block layout only, so the two renderers
 * agree. The blue block and every column/entry row are TABLE cells — a cell
 * background paints full width/height in mPDF where a <div> background paints
 * one rect per text line (skill §5).
 *
 * multipage:false — single-page showcase layout; the builder's overflow
 * warning steers long profiles elsewhere.
 */

/* ---- 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-lumiere {
    width: 794px;               /* A4 @ 96dpi -> fills A4 width in mPDF */
    box-sizing: border-box;
    background: #ffffff;
    color: #1f2937;
    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, skill
   §5). This template's header, entry rows, chip grid and language grid are all
   tables, so the font must be declared at td level too. No-op in the browser.
   Header/blue-block cells override color below (rules ordered after this). */
.resume-lumiere td {
    font-family: 'DejaVu Sans', Helvetica, Arial, sans-serif;
    font-size: 13.5px;
    line-height: 1.45;
    color: #1f2937;
}

/* ---- split header ------------------------------------------------------- */
.resume-lumiere .cv-head-table {
    width: 100%;
    border-collapse: collapse;
}
/* Left: deep-blue photo block. Background on the <td> itself (full-height
   paint). vertical-align:middle keeps the photo/name stack centred against the
   taller white cell beside it. */
/* The outer cell carries the blue in the BROWSER (full-bleed, zero padding) but
   mPDF does not paint it — the inner stack cells below carry the blue in the PDF.
   vertical-align:top so the block hugs the top of the header row. */
.resume-lumiere .cv-head-left {
    width: 40%;
    background: #1e3a8a;
    vertical-align: top;
    padding: 0;
}
/* Inner stack: one contiguous blue table (blue on every cell so mPDF paints it),
   gaps via cell padding (not margins, which mPDF drops in a cell). This is the
   full blue block in the PDF; insets live here since the outer cell has none. */
.resume-lumiere .cv-head-stack {
    width: 100%;
    border-collapse: collapse;
}
.resume-lumiere .cv-head-stack td {
    background: #1e3a8a;
    text-align: center;
    color: #ffffff;
}
.resume-lumiere .cv-head-photo-cell {
    padding: 30px 20px 0;
}
/* 120px circle photo, centred. Block image centred via auto margins (the
   classic-template technique) plus text-align:center on the cell as a hedge. */
.resume-lumiere .cv-head-photo-cell .cv-photo,
.resume-lumiere .cv-head-photo-cell .cv-photo-initials {
    margin: 0 auto;
    display: block;
}
.resume-lumiere .cv-head-name-cell {
    padding: 16px 20px 0;      /* gap photo -> name */
}
.resume-lumiere .cv-head-title-cell {
    padding: 6px 20px 30px;    /* gap name -> title, plus the block's bottom inset */
}
.resume-lumiere .cv-name {
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 0.3px;
    line-height: 1.2;
    margin: 0;
    color: #ffffff;
}
.resume-lumiere .cv-jobtitle {
    font-size: 13px;
    margin: 0;
    /* Solid hex, not rgba(): mPDF does not reliably parse rgba, and the title
       would fall back to the inherited full white. This muted tone renders in
       both engines. */
    color: #c7d3ec;
}

/* Right: white cell with summary on top, contact stack beneath. */
.resume-lumiere .cv-head-right {
    width: 60%;
    background: #ffffff;
    vertical-align: top;
    padding: 30px 32px;
}
.resume-lumiere .cv-summary {
    font-size: 12.5px;
    color: #374151;
    line-height: 1.55;
    text-align: left;
}
/* Nested table gives the summary -> contacts gap its margin (block margins are
   dropped inside a <td> in mPDF, but a nested table's margin survives). */
.resume-lumiere .cv-contact-wrap {
    width: 100%;
    border-collapse: collapse;
    margin-top: 18px;
}
.resume-lumiere .cv-contact-wrap td {
    padding: 0;
}
.resume-lumiere .cv-contact-line {
    font-size: 12px;
    color: #374151;
    line-height: 2;            /* inter-line spacing (block margins dropped in td) */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Accent glyphs. The linkedin badge and www text already carry the accent from
   tpl_icon(); email/phone/location/website text-glyphs are coloured here. */
.resume-lumiere .cv-contact-line .cv-icon-email,
.resume-lumiere .cv-contact-line .cv-icon-phone,
.resume-lumiere .cv-contact-line .cv-icon-location,
.resume-lumiere .cv-contact-line .cv-icon-website {
    color: #1e3a8a;
}

/* ---- body --------------------------------------------------------------- */
/* No BOTTOM padding: it is real trailing space, so when content ends near the
   page boundary mPDF opens a further page to place it and paints nothing. That
   was this template's blank page 2 on a normal-length resume — [1664, 0] chars
   with 32px here, a clean single page with 0. Keep bottom padding at 0 on any
   wrapper that can reach the page boundary. */
.resume-lumiere .cv-body {
    padding: 26px 40px 0;
}
/* Unconditional margin-TOP, not margin-bottom and not a `+` sibling rule.
   Several .cv-section elements here also carry .cv-section-head-group
   (page-break-inside:avoid), and margin-bottom on a repeated avoid block is
   double-counted in mPDF's pagination-height estimate, opening a phantom blank
   page (skill §5) — that is what made this template export a blank page 2 on a
   normal-length resume. Sibling (`+`) rules are not a safe substitute: mPDF's
   support for them is context-dependent (silently inert on editorial). */
.resume-lumiere .cv-section {
    margin-top: 16px;
}
.resume-lumiere .cv-section-title {
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #1e3a8a;
    border-bottom: 1px solid #cbd5e1;
    padding-bottom: 4px;
    margin: 0 0 10px;
}

/* ---- entry items -------------------------------------------------------- */
/* Keep-together (skill §7): without page-break-inside:avoid mPDF splits an
   entry's title away from its bullets across a page boundary. */
/* Same unconditional margin-top rule as .cv-section above, same reasons —
   .cv-item is the repeated avoid block the §5 finding was measured on. */
.resume-lumiere .cv-item {
    position: relative;
    margin-top: 12px;
    page-break-inside: avoid;
}
/* Heading + its FIRST entry move as one block (mPDF ignores
   page-break-after:avoid on a heading alone). Also carried by the compact
   chip/grid sections, which move whole. */
.resume-lumiere .cv-section-head-group {
    page-break-inside: avoid;
}
/* Two-column "title left / dates right" via table (mPDF-safe). */
.resume-lumiere .cv-row {
    width: 100%;
    border-collapse: collapse;
}
.resume-lumiere .cv-row td {
    vertical-align: top;
    padding: 0;
}
.resume-lumiere .cv-row-main {
    text-align: left;
}
.resume-lumiere .cv-row-side {
    text-align: right;
    white-space: nowrap;
    width: 30%;
    color: #4b5563;
    font-size: 12px;
}
.resume-lumiere .cv-item-title {
    font-weight: bold;
    color: #111827;
}
.resume-lumiere .cv-item-org {
    color: #1e3a8a;
}
.resume-lumiere .cv-item-sep {
    color: #333;
}
.resume-lumiere .cv-item-loc {
    color: #6b7280;
    font-style: italic;
}
.resume-lumiere .cv-dates {
    font-weight: bold;
}
.resume-lumiere .cv-item-details {
    margin-top: 3px;
}

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

/* ---- skills chip grid (pdf) --------------------------------------------- */
/* The pill background/padding is on the <td> itself: an inline-block span's
   padding/background is dropped inside a table cell in mPDF (skill §5).
   border-spacing gaps the pills; a 3px radius rounds in the browser (square in
   mPDF, an accepted sub-pixel difference). */
.resume-lumiere .cv-chip-grid {
    width: 100%;
    border-collapse: separate;
    border-spacing: 6px;
    margin: -6px;              /* cancel border-spacing's outer gutter */
}
.resume-lumiere .cv-chip-cell {
    width: 33%;
    background: #eef2fb;
    color: #1e3a8a;
    font-size: 12px;
    text-align: center;
    padding: 5px 10px;
    border-radius: 3px;
}
.resume-lumiere .cv-chip-cell--empty {
    width: 33%;
    background: transparent;
}

/* ---- languages two-column dot table (pdf) ------------------------------- */
.resume-lumiere .cv-lang-grid {
    width: 100%;
    border-collapse: collapse;
}
.resume-lumiere .cv-lang-cell {
    width: 50%;
    vertical-align: top;
    padding: 0 16px 6px 0;
}
.resume-lumiere .cv-lang-name {
    font-weight: bold;
    color: #111827;
}
.resume-lumiere .cv-lang-cell--empty {
    width: 50%;
}

/* Dot glyphs (languages). Filled dots take the accent via inline style from
   tpl_dots(); empty dots are a light gray. */
.resume-lumiere .cv-level {
    margin-left: 6px;
    white-space: nowrap;
    font-size: 10px;
    letter-spacing: 1px;
}
.resume-lumiere .cv-dot {
    font-size: 10px;
    letter-spacing: 1px;
}
.resume-lumiere .cv-dot-off {
    color: #cbd5e1;
}

/* ---- languages / certifications (inline rows in edit; certs rows in pdf) - */
.resume-lumiere .cv-inline-item {
    position: relative;
    margin-bottom: 3px;
    page-break-inside: avoid;
}
.resume-lumiere .cv-item-side {
    float: right;
    width: 28%;
    text-align: right;
    color: #4b5563;
    font-size: 12px;
}
.resume-lumiere .cv-muted {
    color: #6b7280;
}

/* ---- skills chips (edit mode only — inline-block flow in the browser) ---- */
.resume-lumiere .cv-chips {
    line-height: 2;
}
.resume-lumiere .cv-chip {
    position: relative;
    display: inline-block;
    margin: 0 6px 4px 0;
    padding: 3px 10px;
    background: #eef2fb;
    color: #1e3a8a;
    border-radius: 3px;
    font-size: 12px;
}

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

/* contenteditable placeholders */
.resume-lumiere [contenteditable][data-ph]:empty:before {
    content: attr(data-ph);
    color: #b7b7b7;
    font-style: italic;
    pointer-events: none;
}
.resume-lumiere .cv-head-left [contenteditable][data-ph]:empty:before {
    color: rgba(255, 255, 255, 0.7);
}
.resume-lumiere [contenteditable] {
    outline: none;
    border-radius: 2px;
    transition: box-shadow 0.12s ease, background 0.12s ease;
}
.resume-lumiere [contenteditable]:hover {
    box-shadow: 0 0 0 1px #d6e2ff;
}
.resume-lumiere [contenteditable]:focus {
    box-shadow: 0 0 0 2px #2563eb;
    background: #f5f9ff;
}
.resume-lumiere .cv-head-left [contenteditable]:hover {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.6);
}
.resume-lumiere .cv-head-left [contenteditable]:focus {
    box-shadow: 0 0 0 2px #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

/* level dot buttons + toggle (languages) */
.resume-lumiere .cv-dot-btn {
    background: none;
    border: none;
    padding: 0 1px;
    font-size: 11px;
    line-height: 1;
    cursor: pointer;
    color: #cbd5e1;
}
.resume-lumiere .cv-dot-btn.cv-dot-on {
    color: #1e3a8a;
}
.resume-lumiere .cv-level-toggle {
    font-family: inherit;
    font-size: 10px;
    line-height: 1;
    margin-left: 4px;
    padding: 1px 3px;
    border: 1px solid #ccc;
    background: #fff;
    color: #555;
    border-radius: 3px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.12s ease;
}
.resume-lumiere .cv-inline-item:hover .cv-level-toggle {
    opacity: 1;
}
.resume-lumiere .cv-level-text {
    display: inline-block;
    min-width: 20px;
    color: #444;
}

/* chip remove button (edit) */
.resume-lumiere .cv-chip-x {
    font-family: inherit;
    border: none;
    background: none;
    color: #b00;
    cursor: pointer;
    padding: 0 0 0 4px;
    opacity: 0;
    font-size: 13px;
}
.resume-lumiere .cv-chip:hover .cv-chip-x {
    opacity: 1;
}

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

.resume-lumiere .cv-add {
    font-family: inherit;
    font-size: 12.5px;
    margin-top: 6px;
    padding: 4px 10px;
    border: 1px dashed #a9b6d8;
    background: #fff;
    color: #1e3a8a;
    border-radius: 4px;
    cursor: pointer;
}
.resume-lumiere .cv-add:hover {
    background: #f2f5fb;
    border-color: #1e3a8a;
}
.resume-lumiere .cv-add--sm {
    font-size: 11.5px;
    padding: 2px 8px;
}

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