/* ═══════════════════════════════════════════════════
   Tony DiLoreto — /cv
   Extends styles.css. Tokens inherited from :root there.
   ═══════════════════════════════════════════════════ */

/* Author display rules below would otherwise beat the UA [hidden] rule. */
[hidden] {
    display: none !important;
}

/* ════════ MASTHEAD ════════ */
.cv-masthead {
    padding: 40px 0 56px;
    border-bottom: 1px solid var(--rule);
}

.cv-name {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.1rem, 5vw, 3.4rem);
    font-weight: 700;
    line-height: 1.1;
    color: var(--text);
    margin-bottom: 18px;
}

.cv-tagline {
    font-size: 1rem;
    color: var(--text-mid);
    line-height: 1.7;
    max-width: 640px;
    margin-bottom: 26px;
}

.cv-contact {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 26px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.72rem;
    color: var(--text-dim);
    letter-spacing: 0.04em;
    margin-bottom: 36px;
}

.cv-contact a {
    color: var(--text-mid);
}

.cv-contact a:hover {
    color: var(--accent);
    opacity: 1;
}

/* ════════ TRACK SWITCH ════════ */
.cv-switch {
    display: inline-flex;
    border: 1px solid var(--rule);
    margin-bottom: 28px;
}

.cv-switch button {
    background: transparent;
    border: none;
    border-right: 1px solid var(--rule);
    color: var(--text-mid);
    font-family: 'Poppins', sans-serif;
    font-size: 0.66rem;
    font-weight: 400;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    padding: 13px 24px;
    cursor: pointer;
    transition: color 0.3s, background 0.3s;
}

.cv-switch button:last-child {
    border-right: none;
}

.cv-switch button:hover {
    color: var(--text);
}

.cv-switch button[aria-pressed="true"] {
    background: var(--accent-dim);
    color: var(--accent);
}

.cv-switch button:focus-visible,
.cv-entry-toggle:focus-visible,
.cv-utility button:focus-visible {
    outline: 1px solid var(--accent);
    outline-offset: 2px;
}

.cv-switch-note {
    display: block;
    font-size: 0.78rem;
    color: var(--text-dim);
    max-width: 460px;
    margin-bottom: 30px;
    line-height: 1.6;
}

/* ════════ ACTIONS ════════ */
.cv-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}

.cv-download {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 15px 30px;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    transition: all 0.4s ease;
}

.cv-download:hover {
    background: var(--accent);
    color: var(--bg);
    opacity: 1;
}

.cv-download svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
}

.cv-print {
    background: transparent;
    border: 1px solid var(--rule);
    color: var(--text-mid);
    font-family: 'Poppins', sans-serif;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    padding: 15px 26px;
    cursor: pointer;
    transition: all 0.4s ease;
}

.cv-print:hover {
    border-color: var(--text-mid);
    color: var(--text);
}

.cv-updated {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    color: var(--text-dim);
}

/* ════════ SECTIONS ════════ */
.cv-section {
    padding: 72px 0;
    border-bottom: 1px solid var(--rule);
}

.cv-section:last-of-type {
    border-bottom: none;
}

.cv-lede {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.15rem, 2.2vw, 1.45rem);
    color: var(--text);
    line-height: 1.55;
    max-width: 760px;
    margin-bottom: 24px;
}

.cv-section p {
    color: var(--text-mid);
    line-height: 1.85;
    max-width: 760px;
    margin-bottom: 20px;
}

/* ════════ STATS ════════ */
.cv-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1px;
    background: var(--rule);
    border: 1px solid var(--rule);
    margin-top: 44px;
}

.cv-stat {
    background: var(--surface);
    padding: 26px 22px;
}

.cv-stat-num {
    display: block;
    font-family: 'Playfair Display', serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 6px;
}

.cv-stat-label {
    font-size: 0.76rem;
    color: var(--text-mid);
    line-height: 1.5;
}

/* ════════ CAREER SPINE ════════ */
.cv-utility {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 8px;
}

.cv-utility button {
    background: none;
    border: none;
    color: var(--text-dim);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.68rem;
    letter-spacing: 0.06em;
    cursor: pointer;
    padding: 6px 0;
    transition: color 0.3s;
}

.cv-utility button:hover {
    color: var(--accent);
}

.cv-spine {
    position: relative;
    padding-left: 34px;
}

.cv-spine::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 10px;
    bottom: 10px;
    width: 1px;
    background: linear-gradient(to bottom,
            var(--accent) 0%,
            var(--rule) 55%,
            var(--rule) 100%);
    opacity: 0.5;
}

.cv-entry {
    position: relative;
    padding: 0 0 40px;
}

.cv-entry:last-child {
    padding-bottom: 0;
}

.cv-entry::before {
    content: "";
    position: absolute;
    left: -34px;
    top: 11px;
    width: 9px;
    height: 9px;
    border: 1px solid var(--accent);
    background: var(--bg);
    transform: rotate(45deg);
}

.cv-entry.is-current::before {
    background: var(--accent);
}

.cv-entry-toggle {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 20px;
    width: 100%;
    background: none;
    border: none;
    border-bottom: 1px solid var(--rule);
    padding: 4px 0 14px;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
}

.cv-entry-heads {
    flex: 1;
    min-width: 0;
}

.cv-entry-company {
    display: block;
    font-size: 1.08rem;
    font-weight: 500;
    color: var(--text);
    line-height: 1.4;
    transition: color 0.3s;
}

.cv-entry-toggle:hover .cv-entry-company {
    color: var(--accent);
}

.cv-entry-role {
    display: block;
    font-size: 0.88rem;
    color: var(--text-mid);
    line-height: 1.6;
    margin-top: 2px;
}

.cv-entry-dates {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--text-dim);
    white-space: nowrap;
    letter-spacing: 0.03em;
}

.cv-entry-chevron {
    display: inline-block;
    margin-left: 10px;
    color: var(--text-dim);
    transition: transform 0.3s ease;
    font-size: 0.7rem;
}

.cv-entry-toggle[aria-expanded="true"] .cv-entry-chevron {
    transform: rotate(180deg);
}

.cv-entry-detail {
    padding-top: 18px;
}

.cv-entry-toggle[aria-expanded="false"]+.cv-entry-detail {
    display: none;
}

.cv-entry-descriptor {
    font-style: italic;
    font-size: 0.88rem;
    color: var(--text-dim);
    line-height: 1.7;
    max-width: 720px;
    margin-bottom: 16px;
}

.cv-entry-list {
    list-style: none;
    max-width: 760px;
}

.cv-entry-list li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 12px;
    font-size: 0.94rem;
    color: var(--text-mid);
    line-height: 1.8;
}

.cv-entry-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 12px;
    width: 8px;
    height: 1px;
    background: var(--accent);
    opacity: 0.6;
}

.cv-entry-list strong {
    color: var(--text);
    font-weight: 500;
}

.cv-subrole {
    margin-top: 26px;
    padding-top: 20px;
    border-top: 1px solid var(--rule);
}

.cv-subrole-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 16px;
    margin-bottom: 14px;
}

.cv-subrole-title {
    font-size: 0.92rem;
    color: var(--text);
    font-weight: 400;
}

/* ════════ SIMPLE BLOCKS ════════ */
.cv-block {
    padding: 20px 0;
    border-bottom: 1px solid var(--rule);
    max-width: 820px;
}

.cv-block:last-child {
    border-bottom: none;
}

.cv-block-label {
    display: block;
    font-size: 0.98rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}

.cv-block-body {
    font-size: 0.92rem;
    color: var(--text-mid);
    line-height: 1.8;
}

.cv-block-meta {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.7rem;
    color: var(--accent);
    letter-spacing: 0.04em;
    margin-top: 6px;
}

.cv-note {
    border-left: 2px solid var(--accent);
    padding: 4px 0 4px 24px;
    max-width: 720px;
}

.cv-note p {
    margin-bottom: 0;
}

/* ════════ RESPONSIVE ════════ */
@media (max-width: 900px) {
    .cv-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 620px) {
    .cv-stats {
        grid-template-columns: 1fr;
    }

    .cv-entry-toggle {
        flex-direction: column;
        gap: 8px;
    }

    .cv-spine {
        padding-left: 24px;
    }

    .cv-entry::before {
        left: -24px;
    }

    .cv-switch {
        width: 100%;
    }

    .cv-switch button {
        flex: 1;
        padding: 13px 10px;
    }

    .cv-download,
    .cv-print {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {

    .cv-entry-chevron,
    .cv-download,
    .cv-print,
    .cv-switch button {
        transition: none;
    }
}

/* ════════ PRINT ════════ */

/* Top/bottom must come from @page — it is the only inset that repeats on
   every page. Sides come from main, so they survive a "Margins: None"
   print setting instead of collapsing to the paper edge. */
@page {
    margin: 0.5in 0.1in;
}

@media print {

    .grain,
    .topbar,
    .breadcrumb,
    .footer,
    .cv-actions,
    .cv-switch,
    .cv-switch-note,
    .cv-utility,
    .cv-entry-chevron,
    .cv-cta {
        display: none !important;
    }

    :root {
        --bg: #fff;
        --surface: #fff;
        --text: #111;
        --text-mid: #2e2e33;
        --text-dim: #6b6b74;
        --accent: #8a7442;
        --rule: #d8d5cc;
    }

    /* Component sizes are in rem, which resolves against html — not body.
       Scaling the root is what actually shrinks the document. */
    html {
        font-size: 8.9pt;
    }

    body {
        background: #fff;
        color: #111;
        font-size: 1rem;
        line-height: 1.42;
        orphans: 2;
        widows: 2;
    }

    main {
        max-width: none;
        padding: 0 0.45in;
    }

    a {
        color: #111;
        text-decoration: none;
    }

    /* ── Masthead ── */
    .cv-masthead {
        padding: 0 0 9pt;
    }

    .cv-name {
        font-size: 1.95rem;
        margin-bottom: 5pt;
    }

    .cv-tagline {
        font-size: 1rem;
        line-height: 1.38;
        max-width: none;
        margin-bottom: 6pt;
    }

    .cv-contact {
        gap: 3pt 13pt;
        font-size: 0.76rem;
        margin-bottom: 0;
    }

    /* ── Sections ── */
    .cv-section {
        padding: 9pt 0;
        border-bottom: none;
    }

    .section-label {
        margin-bottom: 6pt;
        font-size: 0.7rem;
        letter-spacing: 0.2em;
        break-after: avoid;
        page-break-after: avoid;
    }

    .cv-lede {
        font-size: 1.08rem;
        line-height: 1.36;
        max-width: none;
        margin-bottom: 6pt;
    }

    .cv-section p {
        line-height: 1.45;
        max-width: none;
        margin-bottom: 6pt;
    }

    /* ── Stats ── */
    .cv-stats {
        grid-template-columns: repeat(4, 1fr);
        margin-top: 9pt;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .cv-stat {
        border: 1px solid var(--rule);
        padding: 7pt 7pt;
    }

    .cv-stat-num {
        font-size: 1.25rem;
        margin-bottom: 1pt;
    }

    .cv-stat-label {
        font-size: 0.7rem;
        line-height: 1.3;
    }

    /* ── Experience ── */
    .cv-spine {
        padding-left: 0;
    }

    .cv-spine::before,
    .cv-entry::before {
        display: none;
    }

    .cv-entry {
        break-inside: auto;
        page-break-inside: auto;
        padding-bottom: 10pt;
    }

    .cv-entry-toggle[aria-expanded="false"]+.cv-entry-detail {
        display: block !important;
    }

    /* Only the heading is glued to what follows. Gluing the descriptor too
       made the atomic block tall enough to bump whole jobs to a new page. */
    .cv-entry-toggle {
        padding: 0 0 4pt;
        break-inside: avoid;
        page-break-inside: avoid;
        break-after: avoid;
        page-break-after: avoid;
    }

    .cv-entry-company {
        font-size: 1.03rem;
    }

    .cv-entry-role,
    .cv-entry-dates {
        font-size: 0.84rem;
    }

    .cv-entry-detail {
        padding-top: 6pt;
    }

    .cv-entry-descriptor {
        font-size: 0.85rem;
        line-height: 1.38;
        max-width: none;
        margin-bottom: 5pt;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .cv-entry-list {
        max-width: none;
    }

    .cv-entry-list li {
        font-size: 0.94rem;
        line-height: 1.4;
        margin-bottom: 3.5pt;
        padding-left: 11pt;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .cv-entry-list li::before {
        top: 5.5pt;
        width: 6pt;
    }

    .cv-subrole {
        margin-top: 8pt;
        padding-top: 6pt;
        break-inside: auto;
        page-break-inside: auto;
    }

    .cv-subrole-head {
        margin-bottom: 4pt;
        break-inside: avoid;
        page-break-inside: avoid;
        break-after: avoid;
        page-break-after: avoid;
    }

    .cv-subrole-title {
        font-size: 0.94rem;
    }

    /* ── Blocks ── */
    .cv-block {
        padding: 5pt 0;
        max-width: none;
        break-inside: avoid;
        page-break-inside: avoid;
    }

    .cv-block-label {
        font-size: 0.96rem;
        margin-bottom: 1pt;
    }

    .cv-block-body {
        font-size: 0.9rem;
        line-height: 1.4;
    }

    .cv-block-meta {
        font-size: 0.76rem;
        margin-top: 1pt;
    }

    .cv-note {
        max-width: none;
        padding-left: 11pt;
        break-inside: avoid;
        page-break-inside: avoid;
    }
}
