/*
 * Regal template — white left sidebar + violet banner-topped right column.
 * Shared by browser (edit) and mPDF (pdf). No flexbox, no CSS grid: the two
 * columns are a single table (30% / 70%), so the two renderers agree.
 */

/* ---- 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-regal {
    width: 794px;               /* A4 @ 96dpi -> fills A4 width in mPDF */
    box-sizing: border-box;
    background: #ffffff;
    color: #1a1a1a;
    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 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-regal td {
    font-family: 'DejaVu Sans', Helvetica, Arial, sans-serif;
    font-size: 13.5px;
    line-height: 1.45;
    color: #1a1a1a;
}


/* ---- body: floated sidebar + flowed main column (§7a) --------------------
 * WAS a two-cell single-row <table>, which cannot paginate: mPDF only breaks a
 * table between <tr> boundaries and a lone row has none, so the whole body
 * shrank to fit one sheet instead of flowing. The float goes on the SHORT
 * column (the sidebar) and it must precede the flowed column in source order —
 * floating both, or floating the long one, makes mPDF finish one column before
 * starting the other and they render stacked. The main column takes a
 * margin-left, NOT a width, so its indent still holds on pages 2+ where the
 * float no longer exists. No band asset: this sidebar is white, so the page
 * background already supplies it on every page. */
.cv-layout {
    width: 100%;
}
.cv-layout:after {
    content: "";
    display: table;
    clear: both;
}

/* ---- sidebar (left, 30%, white) ----------------------------------------- */
.cv-sidebar {
    float: left;
    width: 30%;
    box-sizing: border-box;
    /* No BOTTOM padding: real trailing space at the page boundary makes mPDF
       open a further page and paint nothing. */
    padding: 30px 20px 0;
}
.cv-sidebar-inner {
    box-sizing: border-box;
}
/* Baseline for text in nested sidebar tables (the generic `.resume-regal td`
   rule would apply the 13.5px body size). Skills lines are 13px; contact
   lines override to 12px below. */
.resume-regal .cv-sidebar td {
    font-size: 13px;
    color: #1a1a1a;
}

/* Photo slot: single-cell table so the slot keeps its geometry inside the
   sidebar cell (block margins are dropped there). */
.cv-photo-wrap {
    border-collapse: collapse;
    margin: 0 auto;
    width: 100%;
}
.cv-photo-wrap td {
    padding: 0;
    text-align: center;
}
.cv-photo,
.cv-photo-initials {
    margin: 0 auto;
}

/* Side sections: the inter-section gap is the title row's uniform
   margin-top (block margins on the .cv-side-section div are dropped inside
   the sidebar cell in mPDF; a nested table's margin renders in both). */
.cv-side-section {
    margin-bottom: 0;
}
.cv-side-title-row {
    width: 100%;
    border-collapse: collapse;
    margin: 22px 0 10px;
}
.cv-side-title-row td {
    border-bottom: 1px solid #d1d5db;
    padding: 0 0 6px;
}
.cv-side-title {
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #4b5563;
    border-bottom: none;
    margin: 0;
    padding: 0;
}

/* Contact list: glyph + text, each on its own line, 12px. Table in pdf
   mode / div in edit mode, same class (margins render on both element
   kinds in their respective renderer). */
.cv-contact-list {
    font-size: 12px;
}
.cv-contact-item {
    color: #333333;
    margin-bottom: 7px;
    word-wrap: break-word;
}
table.cv-contact-item {
    width: 100%;
    border-collapse: collapse;
}
.resume-regal .cv-sidebar .cv-contact-item td {
    padding: 0;
    font-size: 12px;
    color: #333333;
}
.cv-icon {
    display: inline-block;
    margin-right: 5px;
    color: #6b7280;
}
.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;
    border-radius: 2px;
    margin-right: 5px;
}

/* Skills, languages and the Interests custom block moved OUT of the rail on
   2026-08-05 (§7a.3): the rail is a float, and mPDF silently drops
   floated-column entries it will not carry onto the next page. All three now
   render in the main column — skills/languages as a real two-column table grid
   (mPDF does not pack repeated same-direction floats into rows, §5), interests
   through the ordinary custom-section path. The old .cv-side-list /
   .cv-side-plain / .cv-side-def / .cv-interest-* rail rules went with them. */
.cv-skill-grid {
    width: 100%;
    border-collapse: collapse;
}
.cv-skill-col {
    width: 50%;
    padding: 0 10px 5px 0;
    vertical-align: top;
    font-size: 13px;
    line-height: 1.45;
    color: #1a1a1a;
}
/* The odd trailing filler cell carries no content and must not add height. */
.cv-skill-col.cv-skill-col--empty {
    padding: 0;
}

/* Edit-mode tag list for skills/languages. Browser-only markup. */
.cv-taglist {
    margin: 2px 0 0;
}
.cv-tag {
    display: inline-block;
    margin: 0 6px 6px 0;
    padding: 3px 9px;
    border: 1px solid #d1d5db;
    border-radius: 3px;
    font-size: 12.5px;
    line-height: 1.3;
    color: #1a1a1a;
}
.cv-tag-lvl {
    font-style: italic;
    color: #6b7280;
    margin-left: 5px;
}
.cv-tag-x {
    font-family: inherit;
    margin-left: 5px;
    border: none;
    background: none;
    color: #9ca3af;
    cursor: pointer;
    opacity: 0;
}
.cv-tag:hover .cv-tag-x {
    opacity: 1;
}

/* ---- main column (right, 70%) ------------------------------------------- */
/* margin-left, NOT width: the 30% strip must stay reserved on pages 2+, where
   the floated sidebar no longer exists but the main column keeps flowing. */
.cv-main {
    margin-left: 30%;
    box-sizing: border-box;
}

/* Banner: a single-cell table, not a plain div — mPDF paints a <td> background
   as one solid fill spanning the full cell, but a div's background-color
   shrinks to hug each text line's own width instead of the block's full
   width (confirmed via raw PDF content-stream inspection: a div produced one
   small violet rect per line, sized to that line's text, rather than one
   rect spanning the column). Table-cell backgrounds are the proven-safe
   mPDF pattern (see onyx.css). Flush to the right column's own edges — no
   margin, padding lives on the cell itself so the background reaches every
   edge of the column. */
.cv-banner-table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
}
.resume-regal .cv-banner {
    padding: 34px 36px 28px;
    color: #ffffff;
}
.cv-name {
    font-size: 30px;
    font-weight: bold;
    line-height: 1.15;
    margin: 0 0 4px;
    color: #ffffff;
}
.cv-jobtitle {
    font-size: 16px;
    font-weight: normal;
    color: #ffffff;
}
.cv-banner-rule {
    width: 48px;
    height: 2px;
    background: rgba(255, 255, 255, 0.85);
    margin: 12px 0 14px;
}
/* pdf-mode decorative rule: a content-less div's width/height collapse
   inside the banner cell in mPDF and nothing paints — a fixed-layout
   single-cell table with the width on the td and the line as the cell's
   own top border draws it reliably (table-layout:fixed keeps mPDF from
   shrinking the table to its &nbsp; content). */
.cv-banner-rule-tbl {
    border-collapse: collapse;
    table-layout: fixed;
    width: 48px;
    margin: 12px 0 14px;
}
.resume-regal .cv-banner-rule-tbl td {
    width: 48px;
    padding: 0;
    font-size: 1px;
    line-height: 1px;
    border-top: 2px solid rgba(255, 255, 255, 0.85);
}
.cv-banner .cv-summary {
    font-size: 13px;
    color: #ffffff;
    line-height: 1.55;
}
/* The banner is a table cell (see .cv-banner note); the generic td rule
   would otherwise paint the name/title/summary near-black on violet. */
.resume-regal .cv-banner td,
.resume-regal .cv-banner {
    color: #ffffff;
}

/* Body: single-cell table so the column padding survives inside the
   .cv-main cell (a nested div's padding is dropped there in mPDF). */
/* Padding lives here now that .cv-body is a div (it was a single-cell table
   whose td carried it). No BOTTOM padding: real trailing space at the page
   boundary makes mPDF open a further page and paint nothing. */
.cv-body {
    padding: 26px 36px 0;
}

/* Section heading + its FIRST entry travel as one block. mPDF ignores
   page-break-after:avoid on a heading by itself, so without this the title can
   strand at the foot of a page with its entries overleaf (skill §7). The
   heading-only rule below is the correct semantic pairing, not load-bearing on
   its own. Neither wrapper contains a float, so the §7a float-inside-avoid
   duplication bug cannot apply. */
.cv-section-head-group {
    page-break-inside: avoid;
}
.cv-section-title {
    page-break-after: avoid;
}
.cv-section {
    margin-bottom: 18px;
}
.cv-section-title {
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 2px solid;
    margin: 0 0 10px;
    padding: 0 0 5px;
}

/* pdf-mode section title rows: a heading's border-bottom shrinks to its
   text width and its margins are dropped inside the body cell in mPDF —
   the single-cell table's td carries both (accent border color comes from
   the inline style on the td). The margin-top doubles as the inter-section
   gap (.cv-section margins don't survive; edit mode never renders
   .cv-title-row, so the browser is unaffected). */
.cv-title-row {
    width: 100%;
    border-collapse: collapse;
    margin: 18px 0 10px;
}
.cv-title-row td {
    border-bottom: 2px solid;
    padding: 0 0 5px;
}
.cv-title-row .cv-section-title {
    border-bottom: none;
    margin: 0;
    padding: 0;
}

/* ---- items (div in edit mode / table in pdf mode, same class) --------- */
/* Entries are <div>s in BOTH modes now (§7a): an entry built as its own
   <table> gets font-shrunk when it does not fit the space left on the page
   instead of moving to the next one. Spacing is an unconditional margin-TOP —
   never margin-bottom on a repeated page-break-inside:avoid block (mPDF
   double-counts it and opens a phantom blank page) and never a `+` sibling
   rule (mPDF's support for those is context-dependent). */
.cv-item {
    position: relative;
    margin-top: 14px;
    page-break-inside: avoid;
}
.cv-item-cell {
    position: relative;
    padding: 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-regal .cv-row-side {
    text-align: right;
    white-space: nowrap;
    width: 32%;
    color: #444444;
    font-size: 12px;
}
.cv-item-title {
    font-weight: bold;
}
.cv-item-org {
    font-style: italic;
    color: #333333;
}
.cv-item-sep {
    color: #333333;
    font-style: normal;
}
.cv-item-loc {
    font-style: italic;
}
.cv-dates {
    font-weight: bold;
}
.cv-item-details {
    margin-top: 3px;
}

/* Bullets (edit mode: real ul; pdf mode: one two-cell table per bullet —
   the fixed-width marker cell gives a hanging indent that survives mPDF
   inside the body cell, li padding-left does not). */
.cv-bullets {
    margin: 5px 0 0;
    padding-left: 18px;
}
.cv-bullets li {
    margin-bottom: 2px;
    position: relative;
}
.cv-bullet {
    width: 100%;
    border-collapse: collapse;
    margin-top: 2px;
}
.cv-bullet-mk {
    width: 16px;
    vertical-align: top;
    padding: 0;
    color: #4c1d95;
}
.cv-bullet-tx {
    vertical-align: top;
    padding: 0;
}

/* Certifications / custom inline items (edit mode: div + float date; pdf
   mode: two-cell table — the float doesn't float inside the body cell in
   mPDF). */
.cv-inline-item {
    position: relative;
    margin-bottom: 4px;
}
.cv-item-side {
    float: right;
    width: 70px;
    color: #444444;
    font-size: 12px;
}
.cv-cert-row {
    width: 100%;
    border-collapse: collapse;
    margin-top: 4px;
}
.cv-cert-row td {
    vertical-align: top;
    padding: 0;
}
.resume-regal .cv-cert-side {
    width: 70px;
    text-align: right;
    color: #444444;
    font-size: 12px;
}
.cv-muted {
    color: #777777;
}

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

[contenteditable][data-ph]:empty:before {
    content: attr(data-ph);
    color: #b7b7b7;
    font-style: italic;
    pointer-events: none;
}
.cv-banner [contenteditable][data-ph]:empty:before {
    color: rgba(255, 255, 255, 0.65);
}
[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-banner [contenteditable]:hover {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.55);
}
.cv-banner [contenteditable]:focus {
    box-shadow: 0 0 0 2px #ffffff;
    background: rgba(255, 255, 255, 0.12);
}

/* 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-sidebar .edit-controls--inline {
    left: auto;
    right: -20px;
}
.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-add--side {
    border-color: #b7c4e0;
    background: #fff;
    color: #2563eb;
}

.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;
}
