/**
 * Foundation template — education-forward layout for new graduates.
 * Single column, serif, with expanded education entries and equal-weight experience.
 * Accent color: default light blue #1d4ed8.
 */

/* ---- 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: 48px 0 48px 0;
}
@page :first {
    margin-top: 0;
}

.resume-page {
    width: 794px;              /* A4 @ 96dpi -> fills A4 width in mPDF */
    box-sizing: border-box;
    padding: 48px 56px 0;      /* zero bottom: @page margin-bottom now supplies the last page's trailing space on every page; keeping both reserved ~96px and opened a blank final page */
    background: #ffffff;
    color: #222;
    font-family: 'DejaVu Serif', 'Georgia', serif;
    font-size: 11px;
    line-height: 1.4;
}

/* 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-foundation td {
    font-family: 'DejaVu Serif', 'Georgia', serif;
    font-size: 11px;
    line-height: 1.4;
    color: #222;
}


/* ===== HEADER ===== */
.resume-foundation .cv-header {
    text-align: center;
    margin-bottom: 14px;
    padding: 0;
}

.resume-foundation .cv-name {
    font-size: 26px;
    font-weight: bold;
    margin: 0 0 4px 0;
    padding: 0;
    line-height: 1.1;
}

.resume-foundation .cv-jobtitle {
    font-size: 14px;
    /* The live colour is written inline from settings.accentColor by
       foundation.php — this is only the floor if that ever renders without it.
       Never reintroduce var() here: mPDF has no CSS custom-property support,
       so the declaration is silently dropped and the export stops matching the
       browser. */
    color: #1d4ed8;
    font-weight: bold;
    margin: 0 0 6px 0;
    padding: 0;
}

.resume-foundation .cv-contact {
    font-size: 10px;
    color: #555;
    margin: 0;
    padding: 0;
}

.resume-foundation .cv-contact span {
    display: inline;
    margin: 0 4px;
}

.resume-foundation .cv-contact span:first-child {
    margin-left: 0;
}

/* ===== SECTIONS ===== */
.resume-foundation .cv-section {
    margin: 10px 0;
    padding: 0;
}
/* mPDF ignores :last-child for margins, so the last-rendered section carries a
   server-added .is-last instead (skill §5, $lastSection in foundation.php).
   Template-scoped so it OUTRANKS the .cv-section /
   .cv-inline-item rules it must beat: as a bare .is-last it tied them at
   (0,1,0) and lost on source order, silently doing nothing. */
.resume-foundation .is-last {
    margin-bottom: 0;
}

.resume-foundation .cv-section-title {
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #222;
    margin: 8px 0 6px 0;
    padding: 0 0 4px 0;
    border-bottom: 1px solid #ddd;
    page-break-after: avoid;
}
/* page-break-after:avoid on the title alone is not reliable in mPDF — a
 * header can still land as the last line on a page with its first entry
 * pushed to the next one. Wrapping the title together with its first entry
 * in a page-break-inside:avoid group moves the pair to the next page as a
 * unit. */
.resume-foundation .cv-section-head-group {
    page-break-inside: avoid;
}

/* ===== SUMMARY ===== */
.resume-foundation .cv-summary {
    font-size: 11px;
    line-height: 1.5;
    margin: 4px 0;
    padding: 0;
}

/* ===== EXPERIENCE / EDUCATION / CUSTOM ITEMS ===== */
/* margin-TOP only. margin-bottom on a page-break-inside:avoid block that
   repeats per entry is double-counted in mPDF's own pagination estimate, so a
   resume ending near the boundary opens a further page it then paints nothing
   on (skill §5). Unconditional top margin, not the adjacent-sibling form the
   skill suggests: `+` support is context-dependent in mPDF and was measured
   inert on other templates here (see 9d8455a). The first entry in a section
   gains 6px of space, which is the whole cost. */
.resume-foundation .cv-item {
    margin: 6px 0 0;
    padding: 0;
    position: relative;
    page-break-inside: avoid;
}

.resume-foundation .cv-row {
    width: 100%;
    border-collapse: collapse;
    margin: 2px 0;
}

.resume-foundation .cv-row-main {
    width: auto;
    padding: 0;
    vertical-align: baseline;
}

.resume-foundation .cv-row-side {
    width: 140px;
    padding: 0 0 0 8px;
    text-align: right;
    vertical-align: baseline;
}

.resume-foundation .cv-item-title {
    display: block;
    font-weight: bold;
    font-size: 11px;
    margin: 0;
    padding: 0;
}

/* Education degree: bold 15px */
.resume-foundation .cv-item-title.cv-item-title--degree {
    font-size: 15px;
    font-weight: bold;
    margin: 2px 0;
}

.resume-foundation .cv-item-org {
    display: block;
    font-size: 10px;
    margin: 1px 0;
    padding: 0;
}

.resume-foundation .cv-item-field {
    display: block;
    font-size: 10px;
    color: #666;
    margin: 1px 0;
    padding: 0;
}

.resume-foundation .cv-dates {
    font-size: 10px;
    color: #555;
    margin: 0;
    padding: 0;
    float: none;
    width: auto;
}

.resume-foundation .cv-dates .sep {
    display: inline;
    margin: 0 2px;
}

.resume-foundation .cv-item-loc {
    font-size: 10px;
    color: #666;
    margin: 2px 0 0 0;
    padding: 0;
}

.resume-foundation .cv-current {
    display: block;
    font-size: 10px;
    margin: 2px 0 0 0;
    padding: 0;
    cursor: pointer;
}

.resume-foundation .cv-current input {
    margin-right: 3px;
    cursor: pointer;
}

/* Coursework line for education details */
.resume-foundation .cv-item-coursework {
    display: block;
    font-size: 10px;
    color: #666;
    margin: 3px 0 0 0;
    padding: 0;
}

.resume-foundation .cv-coursework-label {
    font-weight: bold;
}

.resume-foundation .cv-item-desc {
    display: block;
    font-size: 10px;
    color: #555;
    margin: 3px 0 0 0;
    padding: 0;
}

/* ===== BULLETS ===== */
.resume-foundation .cv-bullets {
    list-style: none;
    margin: 3px 0 0 0;
    padding: 0;
}

.resume-foundation .cv-bullets li {
    margin: 2px 0;
    padding: 0 0 0 16px;
    position: relative;
}

.resume-foundation .cv-bullet-marker {
    display: inline-block;
    width: 16px;
    margin-left: -16px;
    text-align: left;
}

/* ===== SKILLS ===== */
.resume-foundation .cv-skills-line {
    font-size: 11px;
    line-height: 1.4;
    margin: 2px 0;
    padding: 0;
}

.resume-foundation .cv-taglist {
    display: block;
    margin: 2px 0;
    padding: 0;
}

.resume-foundation .cv-tag {
    display: inline-block;
    margin: 2px 6px 2px 0;
    padding: 0;
    font-size: 11px;
}

.resume-foundation .cv-tag-x {
    display: none;
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 0;
    margin-left: 3px;
    font-size: 12px;
}

/* ===== INLINE ITEMS (languages, certifications) ===== */
/* The certification line's .cv-row table is the only child of this div, so the
   table's own 2px margin would double the gap the div already provides — and
   that extra ~8px was enough to push the FR sample's last custom entry onto a
   second page. The div owns the spacing; the table inside it owns none. */
.resume-foundation .cv-inline-item .cv-row {
    margin: 0;
}
.resume-foundation .cv-inline-item {
    display: block;
    font-size: 10px;
    margin: 2px 0;
    padding: 0;
    page-break-inside: avoid;
}

.resume-foundation .cv-inline-item .cv-item-title {
    display: inline;
    font-weight: bold;
}

.resume-foundation .cv-muted {
    color: #999;
    margin: 0 2px;
}

.resume-foundation .cv-item-side {
    float: right;
}

/* ===== EDIT MODE ===== */
[contenteditable] {
    outline: none;
}

.resume-foundation [contenteditable]:empty:before {
    color: #ccc;
    content: attr(data-ph);
    font-style: italic;
}

.resume-foundation [contenteditable]:focus {
    background-color: rgba(29, 78, 216, 0.1);
    border-radius: 2px;
}

.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-item:hover > .edit-controls,
.cv-inline-item:hover > .edit-controls,
.cv-bullets li:hover > .edit-controls,
.edit-controls:hover {
    opacity: 1;
}

.edit-controls button {
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 2px;
    color: #666;
    cursor: pointer;
    font-size: 12px;
    padding: 2px 5px;
    min-width: 24px;
    margin-left: 2px;
    transition: all 0.2s;
}

.edit-controls button:hover {
    background: #e0e0e0;
    color: #222;
}

.edit-controls--inline button {
    font-size: 10px;
    padding: 1px 3px;
    margin-right: 3px;
    margin-left: 0;
}

.cv-add {
    background: #f0f0f0;
    border: 1px solid #ccc;
    border-radius: 3px;
    color: #666;
    cursor: pointer;
    font-size: 10px;
    padding: 4px 8px;
    margin: 4px 0 0 0;
    transition: all 0.2s;
}

.cv-add:hover {
    background: #e0e0e0;
    color: #222;
}

.cv-add--sm {
    font-size: 9px;
    padding: 2px 6px;
    display: inline-block;
    margin-left: 0;
}
