/* ================================================================
   Resume_v5 — «کارت‌های بنتو مرجانی» (Coral Bento Cards)
   Playful modern resume: light #f4f5fb background, rounded white
   cards in an asymmetric bento grid, coral (#f43f5e -> #fb7185)
   accent. Every class prefixed resume5- to avoid Bootstrap clashes.
   ================================================================ */

.resume5-root {
    --r5-bg: #f4f5fb;
    --r5-card: #ffffff;
    --r5-ink: #1f2030;
    --r5-muted: #6b7280;
    --r5-line: #eceef6;
    --r5-c1: #f43f5e;
    --r5-c2: #fb7185;
    --r5-grad: linear-gradient(135deg, #f43f5e 0%, #fb7185 100%);
    --r5-soft: #fff1f3;
    --r5-radius: 20px;
    font-family: 'Vazirmatn', Vazir, Tahoma, sans-serif;
    background: var(--r5-bg);
    color: var(--r5-ink);
    direction: rtl;
    line-height: 1.9;
    padding: 32px 18px 64px;
    min-height: 100vh;
}

.resume5-root *,
.resume5-root *::before,
.resume5-root *::after {
    box-sizing: border-box;
}

.resume5-wrap {
    max-width: 1080px;
    margin: 0 auto;
}

/* ===== Bento grid ===== */
.resume5-bento {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 20px;
}

.resume5-card {
    background: var(--r5-card);
    border-radius: var(--r5-radius);
    padding: 26px 28px;
    box-shadow: 0 18px 40px -28px rgba(31, 32, 48, .35);
    border: 1px solid var(--r5-line);
    position: relative;
}

/* spans */
.resume5-span6 { grid-column: span 6; }
.resume5-span4 { grid-column: span 4; }
.resume5-span3 { grid-column: span 3; }
.resume5-span2 { grid-column: span 2; }

/* ===== Identity card ===== */
.resume5-id {
    grid-column: span 6;
    background: var(--r5-grad);
    color: #fff;
    overflow: hidden;
    padding: 38px 36px;
    border: none;
}
.resume5-id::before {
    content: '';
    position: absolute;
    top: -70px;
    left: -40px;
    width: 240px;
    height: 240px;
    background: rgba(255, 255, 255, .12);
    border-radius: 50%;
}
.resume5-id::after {
    content: '';
    position: absolute;
    bottom: -90px;
    right: 8%;
    width: 190px;
    height: 190px;
    background: rgba(255, 255, 255, .08);
    border-radius: 50%;
}
.resume5-id-in {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 30px;
    flex-wrap: wrap;
}
.resume5-photo {
    width: 132px;
    height: 132px;
    border-radius: 26px;
    overflow: hidden;
    border: 4px solid rgba(255, 255, 255, .4);
    box-shadow: 0 16px 40px -10px rgba(0, 0, 0, .35);
    flex-shrink: 0;
    transform: rotate(-3deg);
    background: #fff;
}
.resume5-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.resume5-id-txt {
    flex: 1;
    min-width: 240px;
}
.resume5-id-txt h1 {
    font-size: 2.3rem;
    font-weight: 900;
    line-height: 1.25;
    margin: 0;
}
.resume5-role {
    font-size: 1.08rem;
    font-weight: 600;
    opacity: .96;
    margin-top: 6px;
}
.resume5-yearsbadge {
    display: inline-block;
    background: rgba(255, 255, 255, .22);
    padding: 2px 13px;
    border-radius: 30px;
    font-weight: 700;
    margin-right: 6px;
}
.resume5-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}
.resume5-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, .16);
    backdrop-filter: blur(4px);
    padding: 7px 15px;
    border-radius: 30px;
    font-size: .82rem;
    color: #fff;
    text-decoration: none;
    direction: ltr;
}
.resume5-chip i { font-size: .8rem; }
.resume5-dl {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin-top: 20px;
    background: #fff;
    color: var(--r5-c1);
    font-weight: 800;
    padding: 13px 28px;
    border-radius: 30px;
    text-decoration: none;
    font-size: .92rem;
    box-shadow: 0 12px 26px -8px rgba(0, 0, 0, .3);
    transition: transform .25s ease;
    cursor: pointer;
}
.resume5-dl:hover {
    transform: translateY(-3px);
    color: var(--r5-c1);
}

/* ===== Section heading inside card ===== */
.resume5-sec-h {
    display: flex;
    align-items: center;
    gap: 11px;
    font-size: 1.15rem;
    font-weight: 900;
    margin-bottom: 18px;
}
.resume5-sec-h .resume5-badge {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: var(--r5-grad);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: .95rem;
    flex-shrink: 0;
}

/* ===== Summary ===== */
.resume5-summary {
    color: #4b4257;
    font-size: .94rem;
    text-align: justify;
    line-height: 2.1;
}

/* ===== Timeline (experience) ===== */
.resume5-tline {
    position: relative;
    padding-right: 24px;
}
.resume5-tline::before {
    content: '';
    position: absolute;
    right: 5px;
    top: 6px;
    bottom: 6px;
    width: 3px;
    border-radius: 3px;
    background: var(--r5-grad);
}
.resume5-ti {
    position: relative;
    padding: 0 0 22px;
}
.resume5-ti:last-child { padding-bottom: 0; }
.resume5-ti::before {
    content: '';
    position: absolute;
    right: -24px;
    top: 4px;
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: var(--r5-c1);
    border: 3px solid #fff;
    box-shadow: 0 0 0 3px rgba(244, 63, 94, .2);
}
.resume5-ti .resume5-ti-role {
    font-weight: 800;
    font-size: 1rem;
}
.resume5-ti .resume5-ti-org {
    color: var(--r5-c1);
    font-weight: 700;
    font-size: .88rem;
}
.resume5-ti .resume5-meta {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 6px 0;
}
.resume5-ti .resume5-date,
.resume5-ti .resume5-loc {
    font-size: .74rem;
    color: var(--r5-muted);
    background: var(--r5-soft);
    padding: 3px 12px;
    border-radius: 20px;
}
.resume5-ti p {
    color: var(--r5-muted);
    font-size: .86rem;
    text-align: justify;
    margin: 0;
}

/* ===== Skills (chips + bars) ===== */
.resume5-skill { margin-bottom: 15px; }
.resume5-skill:last-child { margin-bottom: 0; }
.resume5-skill .resume5-skill-l {
    display: flex;
    justify-content: space-between;
    font-size: .85rem;
    font-weight: 600;
    margin-bottom: 6px;
}
.resume5-skill .resume5-track {
    height: 9px;
    background: #eef0f6;
    border-radius: 9px;
    overflow: hidden;
}
.resume5-skill .resume5-fill {
    height: 100%;
    border-radius: 9px;
    background: var(--r5-grad);
}

/* ===== Languages ===== */
.resume5-langs {
    display: flex;
    flex-direction: column;
    gap: 11px;
}
.resume5-lng {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: .88rem;
    font-weight: 600;
}
.resume5-lng .resume5-pill {
    font-size: .72rem;
    background: var(--r5-soft);
    color: var(--r5-c1);
    font-weight: 700;
    padding: 3px 13px;
    border-radius: 20px;
}

/* ===== Education ===== */
.resume5-edu {
    background: linear-gradient(120deg, #fff, #fff7f8);
    border: 1px solid #ffe1e6;
    border-radius: 15px;
    padding: 15px 18px;
    margin-bottom: 13px;
}
.resume5-edu:last-child { margin-bottom: 0; }
.resume5-edu .resume5-edu-d {
    font-weight: 800;
    font-size: .92rem;
}
.resume5-edu .resume5-edu-u {
    color: var(--r5-c1);
    font-size: .82rem;
    font-weight: 600;
}
.resume5-edu .resume5-edu-y {
    font-size: .75rem;
    color: var(--r5-muted);
}
.resume5-edu p {
    font-size: .82rem;
    color: var(--r5-muted);
    margin: 6px 0 0;
    text-align: justify;
}

/* ===== Projects (mini cards) ===== */
.resume5-proj-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 14px;
}
.resume5-proj {
    background: linear-gradient(120deg, #fff, #fff7f8);
    border: 1px solid #ffe1e6;
    border-radius: 16px;
    padding: 16px 18px;
    transition: transform .2s ease, box-shadow .2s ease;
}
.resume5-proj:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 30px -18px rgba(244, 63, 94, .5);
}
.resume5-proj h4 {
    font-size: .95rem;
    font-weight: 800;
    margin: 0 0 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.resume5-proj h4 i { color: var(--r5-c1); }
.resume5-proj p {
    font-size: .82rem;
    color: var(--r5-muted);
    margin: 0;
    text-align: justify;
}
.resume5-proj a.resume5-proj-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    font-size: .78rem;
    font-weight: 700;
    color: var(--r5-c1);
    text-decoration: none;
    direction: ltr;
}

/* ===== Certifications ===== */
.resume5-certgrid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.resume5-crt {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 13px 15px;
    border-radius: 14px;
    background: linear-gradient(120deg, #fff, #fff7f8);
    border: 1px solid #ffe1e6;
}
.resume5-crt i {
    width: 36px;
    height: 36px;
    border-radius: 11px;
    background: var(--r5-grad);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.resume5-crt .resume5-crt-n {
    font-weight: 700;
    font-size: .85rem;
}
.resume5-crt .resume5-crt-m {
    font-size: .74rem;
    color: var(--r5-muted);
}

/* ===== Interests (pills) ===== */
.resume5-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}
.resume5-tg {
    font-size: .8rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 30px;
    background: var(--r5-soft);
    color: var(--r5-c1);
    border: 1px solid #ffe1e6;
}

/* ===== Floating download button ===== */
.resume5-fab {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 50;
    background: var(--r5-grad);
    color: #fff;
    border: none;
    padding: 14px 24px;
    border-radius: 50px;
    font-family: inherit;
    font-weight: 800;
    font-size: .9rem;
    cursor: pointer;
    box-shadow: 0 16px 34px -10px rgba(244, 63, 94, .7);
    display: inline-flex;
    gap: 8px;
    align-items: center;
    text-decoration: none;
}
.resume5-fab:hover {
    color: #fff;
    transform: translateY(-3px);
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .resume5-span4,
    .resume5-span3 { grid-column: span 6; }
    .resume5-span2 { grid-column: span 3; }
}
@media (max-width: 600px) {
    .resume5-root { padding: 20px 12px 56px; }
    .resume5-id { padding: 28px 22px; }
    .resume5-id-txt h1 { font-size: 1.8rem; }
    .resume5-span2 { grid-column: span 6; }
    .resume5-card { padding: 22px 20px; }
}

/* ===== Print (save as PDF) ===== */
@media print {
    .resume5-root {
        background: #fff;
        padding: 0;
    }
    .resume5-fab { display: none !important; }
    .resume5-dl { display: none !important; }
    .resume5-card {
        box-shadow: none;
        border: 1px solid #e5e7eb;
        break-inside: avoid;
    }
    .resume5-bento { gap: 12px; }
    .resume5-id {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    @page { size: A4; margin: 12mm; }
}
.resume5-root {overflow-wrap:anywhere;}
.resume5-bento > *, .resume5-id-in > *, .resume5-skill-l > * {min-width:0;}
.resume5-skill-l {gap:8px;flex-wrap:wrap;}
.resume5-demo-note {max-width:1000px;margin:0 auto 18px;color:#475569;}
.resume5-dl {font-family:inherit;cursor:pointer;border:0;}
.resume5-dl:focus-visible {outline:3px solid #a53535;outline-offset:4px;}
@media print {
 body:has(.resume5-root) > :not(.page-card-shell):not(script):not(style):not(link) {display:none!important;}
 body:has(.resume5-root) .page-card-shell {display:block;border:0;}
 .resume5-demo-note {display:none;}
 .resume5-bento {display:block;}
 .resume5-card {break-inside:auto;margin-bottom:4mm;padding:4mm;}
 .resume5-root [data-row-index] {break-inside:avoid;}
 .resume5-sec-h {break-after:avoid;}
 .resume5-root p {font-size:10pt;line-height:1.6;orphans:3;widows:3;}
}
