/* ============================================================
   Resume_v8 — رزومه «مجله‌ای کلاسیک (Serif)»
   Editorial / print-magazine layout. Cream paper, black ink,
   restrained burgundy accent. Serif display headings, drop-cap
   multi-column summary, flush-margin year column, hairline rules.
   Every class prefixed resume8-.
   ============================================================ */

.resume8-root {
    --ink:      #1a1714;
    --ink-soft: #4a423b;
    --ink-faint:#8a8077;
    --paper:    #fbf8f1;
    --paper-2:  #f4eee2;
    --burgundy: #7f1d1d;
    --hair:     #d8cdba;
    --serif: Georgia, "Times New Roman", "Noto Serif", serif;

    background: var(--paper);
    background-image:
        repeating-linear-gradient(0deg, rgba(127,29,29,0) 0, rgba(127,29,29,0) 100%);
    color: var(--ink);
    font-family: Vazir, Tahoma, sans-serif;
    direction: rtl;
    padding: 40px 18px 64px;
    min-height: 100%;
}

.resume8-paper {
    max-width: 920px;
    margin: 0 auto;
    background: var(--paper);
    border: 1px solid var(--hair);
    box-shadow: 0 1px 0 var(--hair), 0 24px 60px -28px rgba(26,23,20,.4);
    padding: 54px 56px 40px;
    position: relative;
}

/* ===== Masthead ===== */
.resume8-masthead {
    text-align: center;
    margin-bottom: 22px;
}
.resume8-kicker {
    font-family: var(--serif);
    font-size: .74rem;
    letter-spacing: .32em;
    text-transform: uppercase;
    color: var(--burgundy);
    margin-bottom: 12px;
}
.resume8-name {
    font-family: var(--serif);
    font-weight: 700;
    font-size: clamp(2.6rem, 7vw, 4.4rem);
    line-height: 1.02;
    letter-spacing: -.01em;
    color: var(--ink);
    margin: 0;
}
.resume8-rule {
    height: 0;
    border-top: 2px solid var(--ink);
    border-bottom: 1px solid var(--ink);
    width: 100%;
    margin: 16px auto 12px;
    position: relative;
}
.resume8-rule::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 50%;
    width: 9px;
    height: 9px;
    background: var(--burgundy);
    transform: translate(-50%, -50%) rotate(45deg);
    border: 1px solid var(--paper);
}
.resume8-jobtitle {
    font-family: var(--serif);
    font-size: .96rem;
    letter-spacing: .34em;
    text-transform: uppercase;
    color: var(--ink-soft);
}

/* ===== Byline ===== */
.resume8-byline {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px 22px;
    padding: 12px 0 18px;
    border-bottom: 1px solid var(--hair);
    margin-bottom: 28px;
    font-size: .82rem;
    color: var(--ink-soft);
}
.resume8-by { display: inline-flex; align-items: center; gap: 6px; }
.resume8-by i { color: var(--burgundy); font-size: .82em; }
.resume8-by a { color: var(--ink-soft); text-decoration: none; }
.resume8-by a:hover { color: var(--burgundy); text-decoration: underline; }

/* ===== Lead / abstract ===== */
.resume8-lead {
    display: grid;
    grid-template-columns: 132px 1fr;
    gap: 28px;
    align-items: start;
    margin-bottom: 34px;
}
.resume8-portrait {
    margin: 0;
    padding: 6px;
    background: var(--paper);
    border: 1px solid var(--ink);
    box-shadow: 0 0 0 4px var(--paper), 0 0 0 5px var(--hair);
}
.resume8-portrait img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    filter: grayscale(100%) contrast(1.04);
}
.resume8-headline {
    font-family: var(--serif);
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--burgundy);
    margin: 0 0 12px;
    line-height: 1.3;
}
.resume8-summary {
    font-family: var(--serif);
    font-size: 1.02rem;
    line-height: 1.75;
    color: var(--ink-soft);
    text-align: justify;
    columns: 2;
    column-gap: 30px;
    column-rule: 1px solid var(--hair);
}
.resume8-summary > :first-child { margin-top: 0; }
/* drop cap on the first letter of the flowing summary */
.resume8-summary::first-letter {
    float: right;
    font-family: var(--serif);
    font-weight: 700;
    font-size: 3.6em;
    line-height: .72;
    padding: 6px 0 0 10px;
    margin: 4px 0 0 6px;
    color: var(--burgundy);
}

/* ===== Two-column editorial body ===== */
.resume8-columns {
    display: grid;
    grid-template-columns: 1fr 250px;
    gap: 40px;
    border-top: 3px double var(--ink);
    padding-top: 30px;
}
.resume8-col--aside {
    border-right: 1px solid var(--hair);
    padding-right: 28px;
}

/* ===== Section headings ===== */
.resume8-section { margin-bottom: 30px; }
.resume8-section:last-child { margin-bottom: 0; }
.resume8-section-title {
    font-family: var(--serif);
    font-weight: 700;
    font-size: 1.18rem;
    color: var(--ink);
    margin: 0 0 16px;
    padding-bottom: 7px;
    border-bottom: 2px solid var(--ink);
    letter-spacing: .02em;
}
.resume8-section-title--sm {
    font-size: .82rem;
    letter-spacing: .26em;
    text-transform: uppercase;
    border-bottom: 1px solid var(--ink);
    color: var(--burgundy);
}

/* ===== Entries (flush-margin year + hanging text) ===== */
.resume8-entry {
    display: grid;
    grid-template-columns: 96px 1fr;
    gap: 18px;
    padding: 0 0 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid var(--hair);
}
.resume8-entry:last-child { border-bottom: 0; margin-bottom: 0; }
.resume8-entry--proj { grid-template-columns: 1fr; }
.resume8-entry-year {
    font-family: var(--serif);
    font-size: .82rem;
    font-weight: 700;
    color: var(--burgundy);
    text-align: left;
    padding-top: 3px;
    letter-spacing: .02em;
}
.resume8-entry-role {
    font-family: var(--serif);
    font-weight: 700;
    font-size: 1.12rem;
    color: var(--ink);
    margin: 0 0 3px;
    line-height: 1.35;
}
.resume8-entry-org {
    font-size: .88rem;
    color: var(--ink-soft);
    font-style: italic;
    margin-bottom: 8px;
}
.resume8-org-name { font-weight: 700; font-style: normal; }
.resume8-org-sep { margin: 0 6px; color: var(--ink-faint); }
.resume8-org-loc { color: var(--ink-faint); }
.resume8-entry-desc {
    font-family: var(--serif);
    font-size: .96rem;
    line-height: 1.7;
    color: var(--ink-soft);
    margin: 0;
    text-align: justify;
}
.resume8-proj-link {
    color: var(--burgundy);
    font-size: .78em;
    margin-right: 8px;
    text-decoration: none;
}
.resume8-proj-link:hover { color: var(--ink); }

/* ===== Ledger rows (skills / languages) ===== */
.resume8-ledger { list-style: none; margin: 0; padding: 0; }
.resume8-ledger-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    padding: 7px 0;
    font-size: .9rem;
}
.resume8-ledger-key { color: var(--ink); white-space: nowrap; }
.resume8-ledger-dots {
    flex: 1;
    border-bottom: 1px dotted var(--ink-faint);
    transform: translateY(-3px);
    min-width: 12px;
}
.resume8-ledger-val {
    font-family: var(--serif);
    font-weight: 700;
    color: var(--burgundy);
    white-space: nowrap;
}

/* ===== Certifications ===== */
.resume8-cert {
    padding: 9px 0;
    border-bottom: 1px solid var(--hair);
}
.resume8-cert:last-child { border-bottom: 0; }
.resume8-cert-name {
    font-family: var(--serif);
    font-weight: 700;
    font-size: .95rem;
    color: var(--ink);
    line-height: 1.4;
}
.resume8-cert-meta {
    font-size: .8rem;
    color: var(--ink-faint);
    font-style: italic;
    margin-top: 2px;
}

/* ===== Interests (comma/dot separated text) ===== */
.resume8-interests {
    margin: 0;
    font-family: var(--serif);
    font-size: .95rem;
    line-height: 1.9;
    color: var(--ink-soft);
}
.resume8-interest:not(:last-child)::after {
    content: " · ";
    color: var(--burgundy);
    font-weight: 700;
}

/* ===== Colophon / download ===== */
.resume8-colophon {
    margin-top: 38px;
    padding-top: 22px;
    border-top: 1px solid var(--hair);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
}
.resume8-colophon-mark {
    font-family: var(--serif);
    font-size: 1.4rem;
    color: var(--ink-faint);
}
.resume8-dl {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-family: var(--serif);
    font-size: .86rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--paper);
    background: var(--ink);
    border: 1px solid var(--ink);
    padding: 11px 26px;
    text-decoration: none;
    transition: background .18s, color .18s;
    cursor: pointer;
}
.resume8-dl:hover { background: var(--burgundy); border-color: var(--burgundy); color: #fff; }

/* ===== Floating action button ===== */
.resume8-fab {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 9990;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--serif);
    font-size: .82rem;
    letter-spacing: .08em;
    color: var(--paper);
    background: var(--burgundy);
    padding: 12px 20px;
    text-decoration: none;
    box-shadow: 0 10px 26px -8px rgba(127,29,29,.6);
    cursor: pointer;
}
.resume8-fab:hover { background: var(--ink); color: var(--paper); }

/* ===== Responsive ===== */
@media (max-width: 760px) {
    .resume8-root { padding: 18px 8px 48px; }
    .resume8-paper { padding: 30px 22px 28px; }
    .resume8-lead { grid-template-columns: 1fr; }
    .resume8-portrait { width: 132px; margin: 0 auto; }
    .resume8-summary { columns: 1; column-rule: 0; }
    .resume8-columns { grid-template-columns: 1fr; gap: 8px; }
    .resume8-col--aside { border-right: 0; padding-right: 0; border-top: 1px solid var(--hair); padding-top: 24px; margin-top: 6px; }
    .resume8-entry { grid-template-columns: 1fr; gap: 4px; }
    .resume8-entry-year { text-align: right; }
}

/* ===== Print (A4) ===== */
@media print {
    .resume8-fab,
    .resume8-colophon { display: none !important; }
    .resume8-root { background: #fff; padding: 0; }
    .resume8-paper {
        max-width: none;
        border: 0;
        box-shadow: none;
        padding: 0;
    }
    .resume8-portrait img { filter: grayscale(100%); }
    .resume8-entry,
    .resume8-section { break-inside: avoid; }
    .resume8-root a { color: var(--ink) !important; text-decoration: none !important; }
}

.resume8-root {overflow-wrap:anywhere;}
.resume8-root *, .resume8-root *::before, .resume8-root *::after {box-sizing:border-box;}
.resume8-col, .resume8-abstract, .resume8-entry-body, .resume8-by, .resume8-by a {min-width:0;}
.resume8-ledger-row {flex-wrap:wrap;gap:6px;}
.resume8-ledger-key {white-space:normal;min-width:0;}
.resume8-colophon {flex-wrap:wrap;}
.resume8-demo-note {max-width:920px;margin:0 auto 18px;color:#4a423b;}
.resume8-dl:focus-visible {outline:3px solid #7f1d1d;outline-offset:4px;}
.resume8-summary::first-letter {float:none;font-size:inherit;line-height:inherit;padding:0;margin:0;font-weight:inherit;color:inherit;}
@media (max-width:900px) {
 .resume8-paper {padding-inline:22px;}
 .resume8-columns {grid-template-columns:minmax(0,1fr) minmax(0,220px);gap:22px;}
 .resume8-summary {columns:1;column-rule:0;}
}
@media (max-width:760px) {.resume8-columns {grid-template-columns:1fr;} }
@media print {
 @page {size:A4;margin:12mm;}
 body:has(.resume8-root) > :not(.page-card-shell):not(script):not(style):not(link) {display:none!important;}
 body:has(.resume8-root) .page-card-shell {display:block;border:0;}
 .resume8-demo-note {display:none;}
 .resume8-columns {display:block;padding-top:4mm;}
 .resume8-col--aside {border:0;padding:0;margin:0;}
 .resume8-summary {columns:1;}
 .resume8-section {break-inside:auto;margin-bottom:5mm;}
 .resume8-root [data-row-index] {break-inside:avoid;}
 .resume8-section-title {break-after:avoid;}
 .resume8-root p {font-size:10pt;line-height:1.6;orphans:3;widows:3;}
 .resume8-name {font-size:28pt;}
 .resume8-lead {margin-bottom:5mm;}
 .resume8-root a {color:var(--ink)!important;text-decoration:none!important;}
}
.resume8-ledger-row {display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:baseline;gap:10px;}
.resume8-ledger-dots {display:none;}
.resume8-ledger-val {white-space:normal;min-width:0;max-width:12ch;overflow-wrap:anywhere;}
