/*
 * Rubis template — 4px ruby frame around the whole page, 60/36 two-column body.
 * Shared by browser (edit) and mPDF (pdf). No flexbox, no CSS grid: every
 * column is a table cell, so the two renderers agree.
 *
 * The frame is a single-cell table whose <td> carries the border and a fixed
 * `height`. mPDF paints cell borders reliably and honors a height declared on
 * a td (treating it as a floor), whereas a wrapper <div> with a border is only
 * as tall as its content — the frame would close halfway down a short resume.
 *
 * Everything on this page lives inside a <td>, so the in-td trap class
 * (2026-07 slate rework) governs the whole file: fonts are declared at td
 * level (mPDF does not inherit font-family/size into cells), every vertical
 * gap is a nested single-cell table's margin (block margins are dropped
 * inside cells), bold is always the `bold` keyword (mPDF ignores numeric
 * weights), and the header rule, bullet markers and skill bars are real cells
 * with real glyphs/backgrounds rather than CSS generated content or block
 * borders (neither survives inside a cell in mPDF).
 *
 * Font stack leads with 'DejaVu Sans': mPDF substitutes Arial with DejaVu
 * Sans *Condensed* regular — no bold face — so bold text would silently
 * export at regular weight without a face mPDF actually embeds.
 */

.resume-page.resume-rubis {
    width: 794px;               /* A4 @ 96dpi -> fills A4 width in mPDF */
    box-sizing: border-box;
    /* The frame's 10px inset. Padding on the page wrapper, NOT a margin on the
       frame table: mPDF drops the top margin of the first block on a page, so
       a margin version printed the frame flush against the paper's top edge
       (confirmed by measuring a real export) while left/right came out right.
       The bottom is 6px rather than 10 purely as browser ballast: mPDF and the
       browser disagree by 4px on where the frame cell ends, and the export is
       the one tuned to a true 10px on all four sides, so the browser canvas
       absorbs the difference here and stays at 1120px — under builder.js's
       1123px page boundary, which would otherwise pin the overflow warning on
       for every resume. */
    padding: 10px 10px 6px;
    background: #ffffff;
    color: #1c1917;
    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. This template is
   tables all the way down, so the font must be declared at td level too.
   No-op in the browser, which inherits normally. */
.resume-rubis td {
    font-family: 'DejaVu Sans', Arial, Helvetica, sans-serif;
    font-size: 13.5px;
    line-height: 1.45;
    color: #1c1917;
}

/* ---- the ruby frame -----------------------------------------------------
 * 794 - 2 x 10px wrapper padding = 774px wide. The cell height is the A4
 * height minus those 10px insets and the 4px border top and bottom, so the
 * frame closes just inside the paper on all four sides: mPDF measures a td's
 * `height` from its padding box (the 28px cell padding counts inside it, the
 * border does not), so the 1104px below was tuned by measuring the red border
 * pixels of a real export until all four gaps read 10px. Re-measure it if the
 * cell padding changes. The border color is also set inline per-resume from
 * settings.accentColor; the value here is the fallback (and what mPDF paints
 * if it skips the inline override). */
.resume-rubis .cv-frame {
    width: 774px;
    margin: 0;
    /* separate + zero spacing, not collapse: with border-collapse the browser
       puts half the cell's 4px border OUTSIDE the row box, so the table came
       out 1104px tall and the page 1124px — one pixel past builder.js's
       1123px page boundary, which would have pinned the overflow warning on
       permanently. Separate borders keep the table exactly as tall as the
       border-box cell. */
    border-collapse: separate;
    border-spacing: 0;
    /* Documents intent only: this layout is one single <tr>, so mPDF has no
       row boundary to break at and auto-shrinks overlong content to fit one
       page instead of paginating (hence multipage:false in the registry — a
       frame cannot span a page break cleanly either). */
    page-break-inside: avoid;
}
.resume-rubis .cv-frame-cell {
    /* border-box is for the BROWSER, which otherwise adds the 28px padding and
       4px border on top of the 1100 and makes the canvas 1184px tall — enough
       for builder.js's height/1123 page count to report 2 pages and pin the
       overflow warning on for every resume. mPDF ignores box-sizing and keeps
       measuring from the padding box either way (re-verified by export). */
    box-sizing: border-box;
    height: 1104px;
    vertical-align: top;
    padding: 28px 30px;
    border: 4px solid #dc2626;
}

/* ---- header: identity left, 120px photo cell right ---------------------- */
.resume-rubis .cv-head {
    width: 100%;
    border-collapse: collapse;
}
.resume-rubis .cv-head-id {
    vertical-align: bottom;
    padding: 0;
}
.resume-rubis .cv-head-photo {
    width: 120px;
    vertical-align: top;
    padding: 0;
    text-align: right;
}
/* No width/height/border-radius here: the pdf-mode no-photo fallback is a
   GD-drawn 100px PNG (tpl_photo's $initialsAsImage) and the photo itself
   carries its geometry inline, because mPDF collapses a styled block div
   inside a table cell. */
.resume-rubis .cv-photo,
.resume-rubis .cv-photo-initials {
    display: block;
    margin-left: auto;
}

/* Name and title: one nested single-cell table each, because a nested table's
   margin is the only reliable vertical-gap primitive inside a <td> (block
   margins on the elements themselves are dropped in mPDF). */
.resume-rubis .cv-name-row,
.resume-rubis .cv-jobtitle-row {
    width: 100%;
    border-collapse: collapse;
}
.resume-rubis .cv-name-row {
    margin: 0 0 6px;
}
.resume-rubis .cv-jobtitle-row {
    margin: 0;
}
.resume-rubis .cv-name-row td,
.resume-rubis .cv-jobtitle-row td {
    padding: 0;
}
.resume-rubis .cv-name {
    font-size: 34px;
    font-weight: bold;
    line-height: 1.1;
    letter-spacing: -0.3px;
    color: #111111;
    margin: 0;
}
/* The ruby tone in the header. The spec's split first/last name is not
   implementable — personal.fullName is one editable field and the x-editable
   directive assigns el.textContent, wiping any inner markup — so the accent
   sits on the title instead (see rubis.php). Color is set inline per-resume
   from settings.accentColor. */
.resume-rubis .cv-jobtitle {
    font-size: 11.5px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2.2px;
}

/* The 2px rule closing the header. A nested single-cell table, not a div:
   mPDF collapses a block div's height inside a cell (it would export as
   nothing at all), while a table keeps its geometry and paints its cell
   background as one contiguous rect in both renderers. The cell carries a
   literal &nbsp; (rubis.php) because mPDF drops a genuinely empty cell; the
   1px font keeps that space from adding height of its own. Background is set
   inline per-resume from settings.accentColor. */
.resume-rubis .cv-headrule {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0 2px;
}
.resume-rubis .cv-headrule td {
    height: 2px;
    line-height: 2px;
    font-size: 1px;
    padding: 0;
}

/* ---- body: 60% history / 36% side rail ---------------------------------- */
.resume-rubis .cv-body {
    width: 100%;
    border-collapse: collapse;
}
.resume-rubis .cv-col-main {
    width: 60%;
    vertical-align: top;
    padding: 0 26px 0 0;    /* the remaining 4% of the row is this gutter */
}
.resume-rubis .cv-col-side {
    width: 36%;
    vertical-align: top;
    padding: 0 0 0 4px;
}
.resume-rubis .cv-section {
    margin: 0;
}

/* Section headers: 13px bold red uppercase. The uniform margin-top is also
   the inter-section gap — no :first-child or sibling override, both
   unreliable in mPDF. Color is set inline from settings.accentColor. */
.resume-rubis .cv-title-row {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0 8px;
}
.resume-rubis .cv-title-row td {
    padding: 0;
}
.resume-rubis .cv-section-title {
    font-size: 13px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    border: none;
    margin: 0;
    padding: 0;
}

/* Generic nested-table gap wrapper (summary, custom-item detail text). */
.resume-rubis .cv-block {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}
.resume-rubis .cv-block td {
    padding: 0;
}
.resume-rubis .cv-summary {
    font-size: 12.5px;
    color: #292524;
    line-height: 1.55;
    text-align: left;      /* never justify: spacing artifacts in mPDF */
}

/* ---- main-column entries ------------------------------------------------ */
.resume-rubis .cv-item {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 13px;
}
.resume-rubis .cv-item-cell {
    position: relative;
    padding: 0;
}

/* Two-column "title left / dates right" via table (mPDF-safe: a float in an
   entry header miscalculates height and can duplicate content on export). */
.resume-rubis .cv-row {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}
.resume-rubis .cv-row td {
    vertical-align: top;
    padding: 0;
}
.resume-rubis .cv-row-main {
    text-align: left;
}
/* The date column carries neither white-space:nowrap NOR an explicit width,
   and both omissions are deliberate:

   - nowrap: mPDF sizes a table from its cells' minimum content widths, and an
     unbreakable run wider than its share of the column makes it shrink the
     WHOLE layout table's font to fit — which here would also scale the
     frame's height floor down, so the ruby border would stop short of the
     page bottom.
   - width: a declared width (tried as both 40% and 152px) is what mPDF
     enforces, and it wrapped "septembre 2016 – mars 2020" onto two lines with
     a lone "2020" hanging under it. Left auto, the cell takes its content
     width and the range fits on one line — verified by real exports both
     ways. */
.resume-rubis .cv-row-side {
    text-align: right;
    color: #78716c;
    font-size: 10.5px;
}
.resume-rubis .cv-sub {
    width: 100%;
    border-collapse: collapse;
    margin: 1px 0 4px;
}
.resume-rubis .cv-sub td {
    padding: 0;
    font-size: 12.5px;
}
.resume-rubis .cv-item-title {
    font-weight: bold;
    color: #111111;
}
.resume-rubis .cv-item-org {
    font-weight: bold;
    color: #57534e;
}
.resume-rubis .cv-item-sep {
    font-weight: normal;
    font-style: normal;
    color: #78716c;
}
.resume-rubis .cv-item-field {
    color: #57534e;
}
.resume-rubis .cv-item-loc {
    font-style: italic;
    color: #78716c;
}
.resume-rubis .cv-dates {
    font-weight: bold;
}
.resume-rubis .cv-item-details {
    font-size: 11.5px;
    color: #57534e;
}

/* Bullets: one two-cell table each — the fixed-width marker cell gives a
   hanging indent both renderers honor (li padding-left and negative-margin
   markers don't survive mPDF inside a table cell). The marker is a real
   square glyph colored on the <td>, never a CSS :before. */
.resume-rubis .cv-bullet {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 3px;
}
.resume-rubis .cv-bullet-mk {
    width: 13px;
    vertical-align: top;
    padding: 0;
    font-size: 6px;
    line-height: 19px;  /* centers the square on the first 12.5px/1.45 text line */
}
.resume-rubis .cv-bullet-tx {
    vertical-align: top;
    position: relative;
    padding: 0;
    font-size: 12.5px;
}

/* Certifications: two-cell row, date right (a float:right date doesn't float
   inside a layout cell in mPDF). */
.resume-rubis .cv-cert-row {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 5px;
}
.resume-rubis .cv-cert-row td {
    vertical-align: top;
    padding: 0;
}
.resume-rubis .cv-cert-main {
    position: relative;
    font-size: 12.5px;
}
.resume-rubis .cv-cert-side {
    width: 70px;
    text-align: right;      /* no nowrap — see .cv-row-side */
    color: #78716c;
    font-size: 10.5px;
}

/* ---- side rail ---------------------------------------------------------- */
/* Contact list: two cells per line — the red glyph gets its own cell so the
   accent color sits on a <td> (reliable in both renderers) instead of being
   inherited down through nested inline spans. One table per line, since block
   margins are dropped inside the rail cell. */
.resume-rubis .cv-contact-item {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 5px;
}
/* Wide enough for the widest glyph, plus nowrap and a padding-right, all three
   for the browser: tpl_icon() emits a trailing &nbsp; after each glyph, and in
   a cell too narrow to hold glyph+nbsp the browser wrapped that space onto a
   second line — the LinkedIn badge (12px + nbsp in an 18px cell) rendered its
   row a full line lower than the ones above it while mPDF kept them even. The
   nowrap run here is ~20px ("www", the widest), far under this column's share
   of the table, so it can't trigger the whole-table shrink that a long nowrap
   date range would. */
.resume-rubis .cv-contact-ic {
    width: 22px;
    padding: 0 5px 0 0;
    vertical-align: top;
    white-space: nowrap;
    font-size: 11px;
}
.resume-rubis .cv-contact-tx {
    padding: 0;
    vertical-align: top;
    color: #292524;
    font-size: 11px;
    word-wrap: break-word;
}
.resume-rubis .cv-icon {
    display: inline-block;
}
.resume-rubis .cv-icon.cv-icon-linkedin {
    display: inline-block;
    width: 12px;
    height: 12px;
    line-height: 12px;
    font-size: 8px;
    font-weight: bold;
    color: #ffffff;
    text-align: center;
}

/* Skills: a thin red bar left of each name. The bar is a 3px cell with an
   accent background, not a border-left on a block — mPDF drops block borders
   and margins inside a table cell, while a cell background paints as one
   contiguous rect the full height of its row. The cell carries a literal
   &nbsp; because mPDF drops a genuinely empty cell; the 1px font keeps that
   space from widening it. */
.resume-rubis .cv-skill {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 5px;
}
.resume-rubis .cv-skill-bar {
    width: 3px;
    padding: 0;
    font-size: 1px;
    line-height: 1px;
}
.resume-rubis .cv-skill-tx {
    padding: 0 0 0 8px;
    vertical-align: top;
    position: relative;
    font-size: 11.5px;
}

/* Education in the rail: one line per field, each its own nested table. */
.resume-rubis .cv-edu {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 11px;
}
.resume-rubis .cv-edu-cell {
    position: relative;
    padding: 0;
}
.resume-rubis .cv-edu-line {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}
.resume-rubis .cv-edu-line td {
    padding: 0;
    font-size: 11.5px;
}
.resume-rubis .cv-edu .cv-item-title {
    font-size: 11.5px;
}
.resume-rubis .cv-edu .cv-dates {
    font-size: 10.5px;
    color: #78716c;
}

/* Languages: name left, dots right, one table per language. */
.resume-rubis .cv-lang {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 5px;
}
.resume-rubis .cv-lang-name {
    padding: 0;
    vertical-align: top;
    position: relative;
    font-size: 11.5px;
    font-weight: bold;
    color: #111111;
}
.resume-rubis .cv-lang-level {
    padding: 0;
    vertical-align: top;
    width: 42%;
    text-align: right;      /* no nowrap: a written level is free text */
    color: #57534e;
    font-size: 10.5px;
}
.resume-rubis .cv-dot {
    font-size: 8px;
    letter-spacing: 1px;
}
.resume-rubis .cv-dot-off {
    color: #e7e5e4;
}

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

/* Kept at two levels deep, never three: mPDF resolves a selector chunk it
   can't parse away and can end up applying the rule to a real pdf-mode
   element (a three-level [contenteditable]:focus rule once repainted a whole
   panel). Nothing here is emitted in pdf mode, so the only thing that matters
   is that no selector can collapse onto an element that exists there. */
.resume-rubis [contenteditable][data-ph]:empty:before {
    content: attr(data-ph);
    color: #b7b7b7;
    font-style: italic;
    pointer-events: none;
}
.resume-rubis [contenteditable] {
    outline: none;
    border-radius: 2px;
    transition: box-shadow 0.12s ease, background 0.12s ease;
}
.resume-rubis [contenteditable]:hover {
    box-shadow: 0 0 0 1px #fecaca;
}
.resume-rubis [contenteditable]:focus {
    box-shadow: 0 0 0 2px #dc2626;
    background: #fef2f2;
}

.resume-rubis .edit-controls {
    position: absolute;
    top: -2px;
    right: -44px;
    opacity: 0;
    transition: opacity 0.12s ease;
    white-space: nowrap;
    z-index: 5;
}
.resume-rubis .edit-controls--inline {
    position: absolute;
    left: -24px;
    right: auto;
    top: 0;
}
.resume-rubis .cv-item-cell:hover > .edit-controls,
.resume-rubis .cv-edu-cell:hover > .edit-controls,
.resume-rubis .cv-bullet-tx:hover > .edit-controls,
.resume-rubis .cv-cert-main:hover > .edit-controls,
.resume-rubis .cv-skill-tx:hover > .edit-controls,
.resume-rubis .cv-lang-name:hover > .edit-controls,
.resume-rubis .edit-controls:hover {
    opacity: 1;
}
.resume-rubis .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-rubis .edit-controls button:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: #fff;
}

.resume-rubis .cv-add {
    font-family: inherit;
    font-size: 12px;
    margin-top: 6px;
    padding: 4px 10px;
    border: 1px dashed #e7e5e4;
    background: #fff;
    color: #b91c1c;
    border-radius: 4px;
    cursor: pointer;
}
.resume-rubis .cv-add:hover {
    background: #fef2f2;
    border-color: #dc2626;
}
.resume-rubis .cv-add--sm {
    font-size: 11px;
    padding: 2px 8px;
}

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

.resume-rubis .cv-level {
    white-space: nowrap;
}
.resume-rubis .cv-dot-btn {
    font-family: inherit;
    font-size: 10px;
    line-height: 1;
    padding: 0 1px;
    border: none;
    background: none;
    cursor: pointer;
    color: #d6d3d1;
}
.resume-rubis .cv-dot-btn.cv-dot-on {
    color: #dc2626;
}
.resume-rubis .cv-level-toggle {
    font-family: inherit;
    font-size: 10px;
    margin-left: 5px;
    padding: 0 4px;
    border: 1px solid #e7e5e4;
    background: transparent;
    color: #a8a29e;
    border-radius: 3px;
    cursor: pointer;
}
.resume-rubis .cv-level-toggle:hover {
    border-color: #dc2626;
    color: #b91c1c;
}
