/*
 * Ambre template — editorial black-and-orange, single page.
 * Shared by browser (edit) and mPDF (pdf). No flexbox, no CSS grid: tables /
 * block layout only, so the two renderers agree.
 *
 * The band background (#0c0a09) and body neutrals are fixed design colors. The
 * accent (default #ea580c) is user data from settings.accentColor and is set
 * INLINE per-element in ambre.php (jobtitle, photo-frame cell, contact rule,
 * section/bullet/skill markers, level dots) so it tracks the user's choice;
 * this file only carries structure and neutrals.
 */

/* ---- 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-ambre {
    width: 794px;               /* A4 @ 96dpi -> fills A4 width in mPDF */
    box-sizing: border-box;
    /* No page padding: the header band is full-bleed to the page edges. The
       contact strip and body carry their own horizontal padding instead. */
    padding: 0;
    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). The band, contact strip, entry rows and both grids are
   tables, so the font must be declared at td level too. No-op in the browser. */
.resume-ambre td {
    font-family: 'DejaVu Sans', Helvetica, Arial, sans-serif;
    font-size: 13.5px;
    line-height: 1.4;
    color: #1a1a1a;
}

/* ---- header band (full-bleed black, name/title left, framed photo right) --
 * Backgrounds on the CELLS, not on a wrapping div: mPDF paints a td background
 * as one contiguous rect, while a div background behind text paints per line
 * (skill §5). */
.cv-header-band {
    width: 100%;
    border-collapse: collapse;
}
.cv-band-main {
    background: #0c0a09;
    vertical-align: middle;
    padding: 38px 24px 38px 48px;
}
.cv-band-side {
    background: #0c0a09;
    width: 172px;
    vertical-align: middle;
    text-align: center;
    padding: 0 36px 0 0;
}
/* The orange photo frame: a nested single-cell table centered in the black
   side cell. A table (not a div) keeps its declared geometry inside a cell and
   paints its background as one contiguous rect; the accent background + 12px
   padding IS the frame (never a border/offset trick — template-specs/ambre.yaml).
   line-height:0 kills the baseline gap under the <img>. */
table.cv-photo-frame {
    border-collapse: collapse;
    margin: 0 auto;
}
table.cv-photo-frame td {
    padding: 12px;
    line-height: 0;
    font-size: 0;
}
.cv-photo,
.cv-photo-initials {
    display: block;
}
/* Header text lives inside a <td>, where mPDF neither inherits the document
   font nor honors numeric weights — size/weight/color are declared explicitly
   and bold is the keyword, never a number. */
.cv-name {
    font-size: 32px;
    font-weight: bold;
    letter-spacing: 0.3px;
    line-height: 1.08;
    margin: 0 0 8px;
    color: #ffffff;
}
.cv-jobtitle {
    font-size: 15px;
    font-weight: bold;
    letter-spacing: 0.4px;
    margin: 0;
    /* color set inline from the accent */
}

/* ---- contact strip (white, accent glyphs, 3px accent rule beneath) ------- */
.cv-contact-strip {
    width: 100%;
    border-collapse: collapse;
}
.cv-contact-cell {
    padding: 12px 48px 11px;
    border-bottom-style: solid;
    border-bottom-width: 3px;
    /* border-bottom-color set inline from the accent */
}
.cv-contact {
    font-size: 12px;
    color: #333333;
}
.cv-contact-item {
    white-space: nowrap;
}
.cv-contact-sep {
    color: #c0bcb8;
}
.resume-ambre .cv-icon {
    display: inline-block;
    margin-right: 3px;
}
.resume-ambre .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: 3px;
}

/* ---- body ---------------------------------------------------------------- */
/* No bottom padding: on export it is real trailing space after the last line,
   and when content ends near the page boundary mPDF opens a blank extra page to
   place it (skill §5, trame). Nothing is visible below the last line anyway. */
.cv-body {
    padding: 22px 48px 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). */
.cv-section-head-group {
    page-break-inside: avoid;
}
.cv-section {
    margin-bottom: 13px;
}
.cv-section:last-child {
    margin-bottom: 0;
}
/* pdf mode: mPDF doesn't reliably honor :last-child, so the server marks
 * whichever section/item renders last with this plain class instead
 * (ambre.php). Unscoped on purpose — applies to whichever element carries it. */
/* 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;
}

/* Section title: accent square marker + bold uppercase text. The marker is a
   real ■ glyph span (skill §5 — never a CSS ::before/background-only box),
   colored inline from the accent. No rule under the title; the marker carries
   the color. */
.cv-section-title {
    font-size: 14px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1.4px;
    color: #111111;
    margin: 0 0 9px;
    page-break-after: avoid;
}
.cv-sec-mk {
    font-size: 10px;
    /* color set inline from the accent */
}
.cv-summary {
    text-align: left;           /* never justify — mPDF spacing artifacts */
}

/* ---- items --------------------------------------------------------------- */
/* Unconditional margin-TOP: never margin-bottom on a repeated
   page-break-inside:avoid block (double-counted in mPDF's pagination estimate,
   opens a phantom blank page — skill §5), and never an adjacent-sibling `+`
   rule (mPDF's `+` support is context-dependent and silently drops in some
   layouts — measured on editorial). Unconditional means no competing override,
   so the nested-avoid cascade bug cannot reappear. */
.cv-item {
    position: relative;
    margin-top: 9px;
    page-break-inside: avoid;
}

.cv-row {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}
.cv-row td {
    vertical-align: top;
    padding: 0;
}
.cv-row-main {
    text-align: left;
}
.resume-ambre .cv-row-side {
    width: 120px;
    text-align: right;
    white-space: nowrap;
    color: #555555;
    font-size: 12.5px;
}
.cv-item-title {
    font-weight: bold;
}
.cv-item-org {
    color: #222222;
}
.cv-item-sep {
    color: #777777;
}
.cv-item-field {
    color: #444444;
}
.cv-item-loc {
    color: #777777;
    font-size: 11.5px;
}
.cv-dates {
    font-weight: bold;
    color: #333333;
}
.cv-item-details {
    margin-top: 3px;
    color: #444444;
}

/* Bullets: list-style off, accent square marker is a real HTML span in the
   markup (CSS generated content never renders in mPDF). Hanging indent via
   padding-left + negative text-indent, which both renderers agree on for a
   list outside a table cell. */
.cv-bullets {
    list-style: none;
    margin: 6px 0 0;
    padding-left: 0;
}
.cv-bullets li {
    position: relative;
    padding-left: 15px;
    text-indent: -15px;
    margin-bottom: 2px;
}
.cv-bullet-mk {
    font-size: 8px;
    /* color set inline from the accent */
}

/* ---- skills / languages two-column grid (pdf mode) ----------------------- */
.cv-grid {
    width: 100%;
    table-layout: fixed;
    border-collapse: collapse;
}
.resume-ambre .cv-grid-col {
    width: 50%;
    vertical-align: top;
    padding: 0 14px 4px 0;
    font-size: 13px;
}
.cv-grid-mk {
    font-size: 8px;
    /* color set inline from the accent */
}
.cv-lang-name {
    font-weight: bold;
}
.cv-lang-level {
    color: #444444;
}
.cv-inline-item {
    position: relative;
    page-break-inside: avoid;
}
.cv-muted {
    color: #777777;
}

/* Skill/language level dots (tpl_dots) — accent-colored on, gray off. */
.cv-level {
    font-size: 10px;
    letter-spacing: 1px;
    margin-left: 4px;
}
.cv-dot-off {
    color: #d4d0cc;
}

/* =====================================================================
 * Edit-mode affordances (browser only — these elements are never emitted in
 * pdf mode, so none of this reaches mPDF). Skills/languages render as a
 * taglist / inline list here for easy editing; pdf mode uses the grid above.
 * ===================================================================== */

.cv-taglist {
    line-height: 2;
}
.cv-tag {
    position: relative;
    display: inline-block;
    margin: 0 6px 4px 0;
    padding: 2px 8px;
    background: #f5f3f1;
    border-radius: 2px;
}

.resume-ambre [contenteditable][data-ph]:empty:before {
    content: attr(data-ph);
    color: #b7b3af;
    font-style: italic;
    pointer-events: none;
}
/* Placeholders on the black band read light. */
.resume-ambre .cv-band-main [contenteditable][data-ph]:empty:before {
    color: rgba(255, 255, 255, 0.55);
}
.resume-ambre [contenteditable] {
    outline: none;
    border-radius: 2px;
    transition: box-shadow 0.12s ease, background 0.12s ease;
}
.resume-ambre [contenteditable]:hover {
    box-shadow: 0 0 0 1px #f3d3bd;
}
.resume-ambre [contenteditable]:focus {
    box-shadow: 0 0 0 2px #ea580c;
    background: #fff7f2;
}
.resume-ambre .cv-band-main [contenteditable]:hover {
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5);
}
.resume-ambre .cv-band-main [contenteditable]:focus {
    box-shadow: 0 0 0 2px #ffffff;
    background: rgba(255, 255, 255, 0.12);
}
.resume-ambre .cv-contact [contenteditable] {
    display: inline-block;
    min-width: 40px;
    margin-right: 10px;
}

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

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

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

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

/* Level dot editor (skills/languages) */
.resume-ambre .cv-level {
    white-space: nowrap;
}
.resume-ambre .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;
}
.resume-ambre .cv-dot-btn.cv-dot-on {
    color: #ea580c;
}
.resume-ambre .cv-dot-btn.cv-dot-off {
    color: #d4d0cc;
}
.resume-ambre .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;
}
.resume-ambre .cv-tag:hover .cv-level-toggle,
.resume-ambre .cv-inline-item:hover .cv-level-toggle {
    opacity: 1;
}
.resume-ambre .cv-level-text {
    display: inline-block;
    min-width: 20px;
}

/* Edit-mode language rows need their own spacing (pdf mode uses the grid). */
.resume-ambre .cv-inline-item {
    margin-top: 4px;
}
/* Edit mode only: the "School , Field" comma sits on its own source line, so
   the HTML newline before it renders as a leading space; this pulls it back.
   Never seen by mPDF (pdf mode glues the comma to the school text). */
.resume-ambre .cv-sep-comma {
    margin-left: -4px;
}
