/* ============================================================
   resume.css  -  PDF-faithful resume in the site's dark theme
   ============================================================ */

/* ====================================================================
   CRITICAL GLOBAL OVERRIDE
   style.css has: section { display:flex; min-height:100vh; }
   That turns every <section class="rp-section"> into a massive
   full-viewport flex column. We hard-reset it here so sections
   behave like normal block elements (rows stacked top-to-bottom).
   ==================================================================== */
.resume-paper section,
.resume-paper section + section,
.rp-section,
.rp-section + .rp-section {
    display: block !important;
    min-height: 0 !important;
    height: auto !important;
    padding: 0 !important;
    align-items: initial !important;
    flex-direction: initial !important;
}

/* ── Page shell ────────────────────────────────────────────── */
.resume-page {
    min-height: 100vh;
    padding: calc(var(--nav-height) + 2rem) 1.5rem 3rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

/* ── Toolbar (Back + Download) ─────────────────────────────── */
.resume-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1050px;
}

.resume-toolbar-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-muted);
    text-decoration: none;
    padding: 0.45rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    transition: all var(--transition);
}

.resume-toolbar-btn:hover {
    color: var(--color-text);
    border-color: var(--color-accent-border);
    background: var(--color-accent-light);
}

.resume-toolbar-btn.primary {
    color: var(--color-accent);
    border-color: var(--color-accent-border);
}

.resume-toolbar-btn.primary:hover {
    background: var(--color-accent-light);
    color: var(--color-text);
}

/* ── The Paper ─────────────────────────────────────────────── */
.resume-paper {
    width: 100%;
    max-width: 1050px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2.5rem 3rem;
    box-shadow: var(--shadow-lg);
    font-family: var(--font-sans);
    color: var(--color-text);
    line-height: 1.5;
}

/* ── Header ────────────────────────────────────────────────── */
.rp-header {
    text-align: center;
    margin-bottom: 1.4rem;
    padding-bottom: 1.2rem;
    border-bottom: 2px solid var(--color-accent);
}

.rp-name {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--color-text);
    margin: 0 0 0.15rem;
    line-height: 1.1;
}

.rp-title {
    font-size: 1rem;
    font-weight: 400;
    color: var(--color-accent);
    margin: 0 0 0.65rem;
    letter-spacing: 0.03em;
}

.rp-contact {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.3rem 0.55rem;
    font-size: 0.82rem;
    color: var(--color-text-secondary);
}

.rp-contact a {
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color var(--transition);
}

.rp-contact a:hover {
    color: var(--color-accent);
}

.rp-contact i {
    margin-right: 0.25rem;
    font-size: 0.78rem;
    color: var(--color-accent);
}

.rp-sep {
    color: var(--color-border-hover);
    user-select: none;
}

/* ── Sections ──────────────────────────────────────────────── */
.rp-section {
    margin-bottom: 1.25rem;
}

.rp-section:last-child {
    margin-bottom: 0;
}

.rp-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--color-accent);
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.3rem !important; /* override global reset only for title */
    margin-bottom: 0.75rem;
}

/* ── Summary ───────────────────────────────────────────────── */
.rp-summary {
    font-size: 0.875rem;
    color: var(--color-text-secondary);
    line-height: 1.65;
    margin: 0;
}

/* ── Education ─────────────────────────────────────────────── */
.rp-edu-item {
    margin-bottom: 0.5rem;
}

.rp-edu-item:last-child {
    margin-bottom: 0;
}

/*
   rp-row: the core horizontal row.
   LEFT side takes all available space, RIGHT (date) is flush right.
   flex-wrap:nowrap forces everything onto ONE line.
*/
.rp-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: nowrap;
}

.rp-degree {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text);
}

.rp-institution {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    margin-top: 0.1rem;
}

.rp-date {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Skills (invisible table) ─────────────────────────────── */
.rp-skills-table {
    width: 100%;
    border-collapse: collapse;
    border: none;
    font-size: 0.875rem;
    line-height: 1.55;
}

.rp-skills-table tr {
    border: none;
}

.rp-skills-table td {
    border: none;
    padding: 0.18rem 0;
    vertical-align: top;
}

.rp-skill-label {
    font-weight: 600;
    color: var(--color-text);
    white-space: nowrap;
    padding-right: 0.75rem;
    width: 210px;
}

.rp-skill-value {
    color: var(--color-text-secondary);
}

/* ── Experience & Jobs ─────────────────────────────────────── */
.rp-job {
    margin-bottom: 1rem;
}

.rp-job:last-child {
    margin-bottom: 0;
}

.rp-job-header {
    margin-bottom: 0.45rem;
    gap: 0.4rem;
}

.rp-job-left {
    display: flex;
    flex-direction: row;  /* ALWAYS row */
    align-items: baseline;
    flex-wrap: nowrap;
    gap: 0.4rem;
    flex: 1;
    min-width: 0;
}

.rp-job-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-text);
    white-space: nowrap;
}

.rp-job-sep {
    color: var(--color-text-muted);
    font-size: 0.8rem;
    flex-shrink: 0;
}

.rp-company {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    font-style: italic;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Projects ──────────────────────────────────────────────── */
.rp-section-header-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0.3rem;
    margin-bottom: 0.75rem;
    gap: 1rem;
}

.rp-section-title--inline {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.rp-view-all {
    font-size: 0.72rem;
    color: var(--color-accent);
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: color var(--transition);
}

.rp-view-all:hover {
    color: var(--color-accent-secondary);
    text-decoration: underline;
}

.rp-project {
    margin-bottom: 0.85rem;
}

.rp-project:last-child {
    margin-bottom: 0;
}

.rp-project-header {
    margin-bottom: 0.35rem;
}

.rp-project-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--color-text);
    flex: 1;
}

.rp-project-link {
    font-size: 0.78rem;
    color: var(--color-accent);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    white-space: nowrap;
    flex-shrink: 0;
    transition: color var(--transition);
}

.rp-project-link:hover {
    color: var(--color-accent-secondary);
}

.rp-project-title-link {
    text-decoration: none;
    color: inherit;
}

.rp-project-title-link:hover .rp-project-title {
    color: var(--color-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ── Bullet Lists ──────────────────────────────────────────── */
.rp-bullets {
    margin: 0;
    padding-left: 1.25rem;
    list-style: none;
}

.rp-bullets li {
    position: relative;
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    line-height: 1.55;
    margin-bottom: 0.28rem;
    padding-left: 0.1rem;
}

.rp-bullets li:last-child {
    margin-bottom: 0;
}

.rp-bullets li::before {
    content: "•";
    position: absolute;
    left: -1rem;
    color: var(--color-accent);
    font-weight: 700;
}

/* ── Certifications ────────────────────────────────────────── */
.rp-cert-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.rp-cert-list li {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.875rem;
}

.rp-cert-icon {
    color: var(--color-accent);
    font-size: 0.75rem;
    flex-shrink: 0;
}

.rp-cert-list a {
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: color var(--transition);
}

.rp-cert-list a:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

/* ── Footer ────────────────────────────────────────────────── */
.resume-footer {
    text-align: center;
    padding: 1.5rem;
    font-size: 0.8rem;
    color: var(--color-text-muted);
    border-top: 1px solid var(--color-border);
    margin-top: 1rem;
}

.resume-footer a {
    color: var(--color-accent);
    text-decoration: none;
}

.resume-footer a:hover {
    text-decoration: underline;
}

/* ── Responsive: shrink font only, NEVER break into columns ── */
@media (max-width: 700px) {
    .resume-page {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }

    .resume-paper {
        padding: 1.4rem 1.1rem;
        border-radius: var(--radius-md);
    }

    .rp-name        { font-size: 1.4rem; letter-spacing: 0.04em; }
    .rp-title       { font-size: 0.88rem; }
    .rp-contact     { font-size: 0.72rem; }
    .rp-summary     { font-size: 0.81rem; }
    .rp-degree      { font-size: 0.82rem; }
    .rp-institution { font-size: 0.76rem; }
    .rp-date        { font-size: 0.72rem; }
    .rp-section-title { font-size: 0.65rem; }
    /* Skills table: just scale font, table layout stays intact */
    .rp-skills-table   { font-size: 0.79rem; }
    .rp-skill-label    { width: 175px; padding-right: 0.5rem; }
    .rp-job-title   { font-size: 0.82rem; }
    .rp-company     { font-size: 0.77rem; }
    .rp-bullets li  { font-size: 0.79rem; }
    .rp-project-title { font-size: 0.82rem; }
    .rp-cert-list li  { font-size: 0.79rem; }
}

@media (max-width: 420px) {
    .resume-paper   { padding: 1.1rem 0.85rem; }
    .rp-name        { font-size: 1.2rem; }
    .rp-skills-table { font-size: 0.74rem; }
    .rp-skill-label  { width: 150px; }
    .rp-bullets li, .rp-summary { font-size: 0.75rem; }
}

/* ── Print ─────────────────────────────────────────────────── */
@media print {
    @page { margin: 0.55in; size: letter; }

    body { background: #fff !important; color: #000 !important; }

    .navbar, .resume-toolbar, .resume-footer { display: none !important; }

    .resume-page { padding: 0; }

    .resume-paper {
        border: none;
        box-shadow: none;
        padding: 0;
        max-width: none;
        background: #fff !important;
        color: #000 !important;
    }

    .rp-name, .rp-degree, .rp-job-title, .rp-project-title,
    .rp-skill-label, .rp-section-title { color: #000 !important; }

    .rp-title, .rp-cert-icon, .rp-project-link,
    .rp-bullets li::before { color: #4f46e5 !important; }

    .rp-summary, .rp-company, .rp-institution, .rp-bullets li,
    .rp-skill-value { color: #333 !important; }

    .rp-date, .rp-contact { color: #555 !important; }
}
