/*
 * Lin template — warm linen page, serif display, single column.
 * Shared by browser (edit) and mPDF (pdf). No flexbox, no CSS grid: floats /
 * tables / block layout only, so the two renderers agree.
 *
 * Palette: linen #faf6f0 page, chocolate #78350f display type, ochre #a16207
 * secondary, hairlines #d6c7b2. These are fixed design colors (not the user's
 * settings.accentColor) so the warm scheme always holds together — level dots
 * are called with a null accent and inherit .cv-dot-on's ochre.
 *
 * Body is a single column that flows directly in the page (not a layout table)
 * so mPDF can paginate between blocks; this template is multipage:true, so
 * there are NO fixed heights anywhere and inter-block spacing is margin-TOP
 * only (a margin-bottom on a repeated page-break-inside:avoid block
 * double-counts in mPDF's pagination estimate and opens a blank trailing page).
 *
 * Font stacks lead with a DejaVu face: mPDF substitutes Arial/Georgia with
 * DejaVu *Condensed* (no bold face), so bold weights would silently export as
 * regular unless the stack pins a face mPDF embeds. Every bold below is the
 * KEYWORD `bold`, never a numeric 600/700 (mPDF ignores numeric weights).
 */

/* PDF-only: paint the linen across the WHOLE sheet on every page. The
   .resume-page background only covers the flowed block, so on page 2 it would
   stop where the content ends and leave the rest white. @page is inert for
   browser screen rendering (the builder chrome is untouched) but mPDF honors
   it.
   The margins are load-bearing too: PdfService gives mPDF margin_* = 0, so the
   wrapper's padding-top is the only vertical margin and it lands on page 1
   alone — page 2 started 1.1% from the sheet edge and ran to 99.1%. `@page
   :first` zeroes the top margin so page 1 keeps using that wrapper padding and
   its output is unchanged; left/right stay 0 because the wrapper's horizontal
   padding already applies to every page. builder.js reads these values back
   out of CSSOM so its page-count model matches what mPDF actually does. */
@page {
    background-color: #faf6f0;
    margin: 36px 0 36px 0;
}
@page :first {
    margin-top: 0;
}

.resume-page.resume-lin {
    width: 794px;                /* A4 @ 96dpi -> fills A4 width in mPDF */
    box-sizing: border-box;
    padding: 36px 60px 0;        /* zero bottom padding: real trailing space opens a blank final page in mPDF (multipage) */
    background: #faf6f0;         /* linen */
    color: #443c33;
    font-family: 'DejaVu Sans', Arial, Helvetica, 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. The photo slot, the
   section rules and every entry row are tables here, so the font must be
   declared at td level too. No-op in the browser. */
.resume-lin td {
    font-family: 'DejaVu Sans', Arial, Helvetica, sans-serif;
    font-size: 13.5px;
    line-height: 1.45;
    color: #443c33;
}

/* ---- header (centered, block-level) -------------------------------------- */
.resume-lin .cv-header {
    text-align: center;
}
/* Photo slot: a single-cell table centered with `margin: 0 auto` — the same
   centering primitive used by the sidebar templates' photo wraps, and the one
   mPDF honors for tables. */
.resume-lin .cv-photo-wrap {
    border-collapse: collapse;
    margin: 0 auto 11px;
}
.resume-lin .cv-photo-wrap td {
    padding: 0;
    text-align: center;
}
.resume-lin .cv-photo,
.resume-lin .cv-photo-initials {
    display: block;
    margin: 0 auto;
}
.resume-lin .cv-name {
    font-family: 'DejaVu Serif', Georgia, 'Times New Roman', serif;
    font-size: 27px;
    font-weight: bold;
    color: #78350f;
    letter-spacing: 0.4px;
    line-height: 1.2;
    margin: 0;
}
.resume-lin .cv-jobtitle {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #a16207;
    margin: 6px 0 0;
}
.resume-lin .cv-contact {
    font-size: 11px;
    color: #6f6456;
    line-height: 1.6;
    margin: 8px 0 0;
}
/* Keeps a value from being split from its neighbours' separators at a wrap. */
.resume-lin .cv-contact-item {
    white-space: nowrap;
}
.resume-lin .cv-contact-sep {
    color: #c0ae95;
}

/* ---- sections ------------------------------------------------------------ */
/* No bottom margins anywhere: the inter-section gap is .cv-sec-title's own
   margin-top, so nothing can reserve trailing space at the end of the flow. */
.resume-lin .cv-section {
    margin: 0;
}
/* pdf mode: mPDF doesn't reliably honor :last-child, so the server marks
   whichever section/item renders last with this plain class instead. Unscoped
   on purpose — it applies to whichever element carries it. Belt-and-braces
   here, since spacing is margin-top only. */
.resume-lin .is-last {
    margin-bottom: 0;
}

/* Section head: centered serif title over a 30px hairline. Kept together as
   one block so a page break can never land between the title and its rule;
   page-break-after:avoid lives on this div (a block) rather than on the rule
   <table>, because mPDF floods BlockTag warnings when page-break-after is
   applied to a table. */
.resume-lin .cv-sec-head {
    text-align: center;
    page-break-inside: avoid;
    page-break-after: avoid;
}
.resume-lin .cv-sec-title {
    font-family: 'DejaVu Serif', Georgia, 'Times New Roman', serif;
    font-size: 15px;
    font-weight: bold;
    color: #78350f;
    letter-spacing: 0.5px;
    margin: 17px 0 0;
}
/* The 30px rule: a single-cell table whose <td> carries the color as a
   background. mPDF paints cell backgrounds as one contiguous rect at the
   declared width, and `margin: 0 auto` centers the table in both renderers —
   a bordered div would stretch to the full column width instead. The &nbsp;
   in the cell keeps mPDF from collapsing an empty row. */
.resume-lin table.cv-sec-rule {
    width: 30px;
    border-collapse: collapse;
    margin: 7px auto 0;
}
.resume-lin table.cv-sec-rule td {
    height: 1px;
    line-height: 1px;
    font-size: 1px;
    padding: 0;
    background: #d6c7b2;
}

/* ---- section head group (multipage: keep the head with its first entry) ----
 * page-break-after:avoid on the title alone is not reliable in mPDF — the
 * page-break-inside:avoid here is what actually holds the head and its first
 * entry together on one page. */
.resume-lin .cv-section-head-group {
    page-break-inside: avoid;
}

.resume-lin .cv-summary {
    margin-top: 9px;
    color: #4a4238;
    line-height: 1.55;
    text-align: left;
}

/* ---- entries ------------------------------------------------------------- */
/* Inter-entry spacing is an UNCONDITIONAL margin-top on every entry (never
   margin-bottom, which double-counts in mPDF's pagination estimate; and never
   a conditional first-item override, which revives that same blank page when
   two avoid blocks nest). The slightly larger gap under a section rule is
   deliberate — it separates the head from the first entry. */
.resume-lin .cv-item {
    position: relative;
    page-break-inside: avoid;
    margin-top: 11px;
}

/* Two-column "title left / dates right" via table (mPDF-safe, no float — a
   float inside a page-break-inside:avoid block makes mPDF miscalculate the
   block height and duplicate content). */
.resume-lin .cv-row {
    width: 100%;
    border-collapse: collapse;
}
.resume-lin .cv-row td {
    vertical-align: top;
    padding: 0;
}
.resume-lin .cv-row-main {
    text-align: left;
}
/* No white-space:nowrap here: a long French date range ("septembre 2017 –
   décembre 2020") is wider than this column anyway, so nowrap wouldn't hold it
   on one line — and a nowrap cell can scale a whole layout table down in mPDF.
   The column is widened instead so most ranges fit unwrapped. */
.resume-lin .cv-row-side {
    text-align: right;
    width: 31%;
}
.resume-lin .cv-item-title {
    font-weight: bold;
    color: #3b332a;
}
/* Serif italic company/school/issuer — the display face carried into the body. */
.resume-lin .cv-item-org {
    font-family: 'DejaVu Serif', Georgia, 'Times New Roman', serif;
    font-style: italic;
    font-size: 13px;
    color: #78350f;
}
.resume-lin .cv-item-sep {
    color: #8b8073;
    font-style: normal;
}
/* edit mode only: the comma between an editable school and field sits on its
   own source line, so it pulls back over that newline's rendered space. In pdf
   mode the comma is emitted glued inside the school span and never uses this. */
.resume-lin .cv-sep-comma {
    margin-left: -4px;
}
.resume-lin .cv-item-field {
    color: #554c41;
}
.resume-lin .cv-item-loc {
    font-size: 11.5px;
    color: #8b8073;
}
.resume-lin .cv-dates {
    font-size: 11.5px;
    letter-spacing: 0.3px;
    color: #a16207;
}
.resume-lin .cv-item-details {
    margin-top: 3px;
    font-size: 12.5px;
    color: #554c41;
}

/* Bullets: native <ul>/<li> with a real • marker span and a hanging indent
   (padding-left + negative text-indent). Native list items let mPDF estimate
   the enclosing avoid block's height accurately, and the marker is real HTML
   text — a CSS content: marker renders nothing at all in mPDF. */
.resume-lin .cv-bullets {
    margin: 4px 0 0;
    padding-left: 0;
    list-style: none;
}
.resume-lin .cv-bullets li {
    position: relative;
    padding-left: 14px;
    text-indent: -14px;
    margin-bottom: 2px;
    color: #4a4238;
    font-size: 13px;
}
.resume-lin .cv-bk {
    color: #a16207;
    margin-right: 6px;
}

/* ---- skills: one centered comma run -------------------------------------- */
.resume-lin .cv-skills-run {
    margin-top: 9px;
    text-align: center;
    color: #4a4238;
    line-height: 1.7;
}
.resume-lin .cv-run-sep {
    color: #8b8073;
}

/* ---- languages: centered "Name — level" lines ---------------------------- */
.resume-lin .cv-langs {
    margin-top: 9px;
    text-align: center;
}
.resume-lin .cv-lang-line {
    position: relative;
    page-break-inside: avoid;
    margin-top: 2px;
}
.resume-lin .cv-lang-name {
    color: #3b332a;
}
.resume-lin .cv-lang-sep {
    color: #c0ae95;
}
/* The level slot holds EITHER dot glyphs or free text (tpl_dots passes text
   through untouched), so the tracking that spaces the dots apart lives on the
   dots themselves — otherwise a written level like "C1 - Autonome" exports as
   letterspaced small type. */
.resume-lin .cv-level {
    font-size: 12px;
    color: #6f6456;
    white-space: nowrap;
}
.resume-lin .cv-dot {
    font-size: 10px;
    letter-spacing: 1px;
}
.resume-lin .cv-dot-on {
    color: #a16207;
}
.resume-lin .cv-dot-off {
    color: #ddd0bd;
}

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

.resume-lin [contenteditable][data-ph]:empty:before {
    content: attr(data-ph);
    color: #b7ac9c;
    font-style: italic;
    pointer-events: none;
}
.resume-lin [contenteditable] {
    outline: none;
    border-radius: 2px;
    transition: box-shadow 0.12s ease, background 0.12s ease;
}
.resume-lin [contenteditable]:hover {
    box-shadow: 0 0 0 1px #e2d2ba;
}
.resume-lin [contenteditable]:focus {
    box-shadow: 0 0 0 2px #a16207;
    background: #fffdf9;
}
.resume-lin .cv-contact [contenteditable] {
    display: inline-block;
    min-width: 40px;
}

.resume-lin .edit-controls {
    position: absolute;
    top: -2px;
    right: -44px;
    opacity: 0;
    transition: opacity 0.12s ease;
    white-space: nowrap;
    z-index: 5;
}
.resume-lin .edit-controls--inline {
    position: absolute;
    left: -26px;
    right: auto;
    top: 0;
}
.resume-lin .cv-item:hover > .edit-controls,
.resume-lin .cv-lang-line:hover > .edit-controls,
.resume-lin .cv-bullets li:hover > .edit-controls,
.resume-lin .edit-controls:hover {
    opacity: 1;
}
.resume-lin .edit-controls button {
    font-family: inherit;
    font-size: 13px;
    line-height: 1;
    width: 20px;
    height: 20px;
    margin-left: 2px;
    padding: 0;
    border: 1px solid #ded0bb;
    background: #fffdf9;
    color: #5b5145;
    border-radius: 3px;
    cursor: pointer;
}
.resume-lin .edit-controls button:hover {
    background: #78350f;
    border-color: #78350f;
    color: #fff;
}

.resume-lin .cv-add {
    font-family: inherit;
    font-size: 12.5px;
    margin-top: 8px;
    padding: 4px 10px;
    border: 1px dashed #d6c7b2;
    background: #fffdf9;
    color: #78350f;
    border-radius: 4px;
    cursor: pointer;
}
.resume-lin .cv-add:hover {
    background: #f3eadd;
    border-color: #a16207;
}
.resume-lin .cv-add--sm {
    font-size: 11.5px;
    padding: 2px 8px;
}

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

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

.resume-lin .cv-dot-btn,
.resume-lin .cv-level-toggle {
    font-family: inherit;
    border: none;
    background: none;
    padding: 0 1px;
    cursor: pointer;
    font-size: 10px;
}
.resume-lin .cv-dot-btn.cv-dot-on {
    color: #a16207;
}
.resume-lin .cv-dot-btn.cv-dot-off {
    color: #ddd0bd;
}
.resume-lin .cv-level-toggle {
    font-size: 9px;
    color: #a99d8c;
    margin-left: 4px;
    opacity: 0;
    transition: opacity 0.12s ease;
}
.resume-lin .cv-skill:hover .cv-level-toggle,
.resume-lin .cv-lang-line:hover .cv-level-toggle {
    opacity: 1;
}
