/* ==========================================================================
   CV: página, hoja (8.5 × 11 in) y dos plantillas
   Fuentes guardadas en el sitio para que el PDF salga igual en cualquier equipo.
   ========================================================================== */
@font-face { font-family: 'Tinos'; src: url('/assets/fonts/tinos-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-style: normal; font-display: block; }
@font-face { font-family: 'Tinos'; src: url('/assets/fonts/tinos-latin-400-italic.woff2') format('woff2'); font-weight: 400; font-style: italic; font-display: block; }
@font-face { font-family: 'Tinos'; src: url('/assets/fonts/tinos-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-style: normal; font-display: block; }
@font-face { font-family: 'CV Oswald'; src: url('/assets/fonts/oswald-latin-500-normal.woff2') format('woff2'); font-weight: 500; font-display: block; }
@font-face { font-family: 'CV Oswald'; src: url('/assets/fonts/oswald-latin-600-normal.woff2') format('woff2'); font-weight: 600; font-display: block; }
@font-face { font-family: 'CV Oswald'; src: url('/assets/fonts/oswald-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: block; }
@font-face { font-family: 'CV Arimo'; src: url('/assets/fonts/arimo-latin-400-normal.woff2') format('woff2'); font-weight: 400; font-display: block; }
@font-face { font-family: 'CV Arimo'; src: url('/assets/fonts/arimo-latin-700-normal.woff2') format('woff2'); font-weight: 700; font-display: block; }

/* ---------- Página ---------- */
.cv-main {
    background-color: #0D0E15;
    padding-bottom: 72px;
}

.cv-hero {
    padding: clamp(36px, 7vh, 64px) 24px;
    background-color: #1D2D44;
    text-align: center;
}

.cv-hero h1 {
    margin: 0;
    color: #F3F4F6;
    font-family: 'MiFuentePersonalizada', 'Oswald', sans-serif;
    font-size: clamp(2.4rem, 5vw, 4rem);
    letter-spacing: var(--tracking-display);
    line-height: 1.1;
    text-transform: uppercase;
}

.cv-hero p {
    max-width: 560px;
    margin: 14px auto 0;
    color: #D1D5DB;
    font-size: 1.1rem;
    line-height: 1.6;
}

.cv-toolbar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 28px;
}

.segmented {
    display: inline-flex;
    padding: 4px;
    border: 1px solid rgba(243, 244, 246, 0.2);
    border-radius: 999px;
}

.segmented button {
    min-height: 40px;
    padding: 8px 18px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: #D1D5DB;
    font-family: 'Arimo', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
}

.segmented button[aria-pressed="true"] {
    background: #F3F4F6;
    color: #0D0E15;
}

.cv-note {
    font-size: 0.9rem !important;
    color: #9CA3AF !important;
}

.cv-stage {
    width: min(100% - 40px, 816px);
    margin: 40px auto 0;
}

.cv-scale {
    position: relative;
}

/* ---------- Hoja ---------- */
.paper {
    width: 8.5in;
    min-height: 11in;
    background: #FFFFFF;
    color: #111827;
    transform-origin: top left;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.cv ul {
    margin: 0;
    padding: 0;
}

/* ==========================================================================
   Plantilla Harvard: texto sobrio, una columna, amigable con ATS
   ========================================================================== */
.cv-harvard {
    padding: 0.5in 0.65in;
    font-family: 'Tinos', 'Times New Roman', serif;
    font-size: 10.5pt;
    line-height: 1.28;
}

.h-head {
    text-align: center;
}

.h-head h1 {
    margin: 0;
    font-size: 20pt;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.h-head p {
    margin: 4px 0 0;
    font-size: 9.5pt;
}

.cv-harvard section {
    margin-top: 10px;
}

.cv-harvard h2 {
    margin: 0 0 6px;
    padding-bottom: 2px;
    border-bottom: 1px solid #111827;
    font-size: 10pt;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.cv-harvard p {
    margin: 0 0 3px;
}

.h-entry {
    margin-bottom: 7px;
}

.h-row {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.h-row span {
    flex-shrink: 0;
    text-align: right;
}

.cv-harvard ul {
    margin: 2px 0 0 18px;
}

.cv-harvard li {
    margin-bottom: 1px;
}

/* ==========================================================================
   Plantilla visual: identidad del portafolio (azul noche + verde)
   ========================================================================== */
.cv-visual {
    display: grid;
    grid-template-columns: 2.75in 1fr;
    min-height: 11in;
    font-family: 'CV Arimo', Arial, sans-serif;
    font-size: 9pt;
    line-height: 1.42;
}

.v-side {
    padding: 0.45in 0.3in;
    background: #1D2D44;
    color: #E5E7EB;
}

.v-photo {
    display: block;
    width: 1.2in;
    height: 1.2in;
    margin: 0 auto 12px;
    border: 3px solid #10B981;
    border-radius: 50%;
    object-fit: cover;
}

.v-side h1 {
    margin: 0;
    color: #FFFFFF;
    font-family: 'CV Oswald', sans-serif;
    font-size: 17pt;
    font-weight: 700;
    line-height: 1.08;
    text-transform: uppercase;
    text-align: center;
}

.v-title {
    margin: 6px 0 2px;
    color: #10B981;
    font-weight: 700;
    text-align: center;
}

.v-location {
    margin: 0;
    color: #9CA3AF;
    font-size: 8.5pt;
    text-align: center;
}

.v-side section {
    margin-top: 14px;
}

.v-side h2,
.v-main h2 {
    margin: 0 0 8px;
    font-family: 'CV Oswald', sans-serif;
    font-size: 11pt;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

.v-side h2 {
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.18);
    color: #FFFFFF;
}

.v-side h3 {
    margin: 8px 0 4px;
    color: #9CA3AF;
    font-size: 7.5pt;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.v-side ul {
    list-style: none;
}

.v-contact li {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 5px;
    font-size: 8.2pt;
}

.v-contact .icon {
    width: 12px;
    height: 12px;
    color: #10B981;
}

.v-contact a {
    color: inherit;
    text-decoration: none;
}

/* Solo en la página y a tamaño real (no en el PDF ni con la hoja reducida): filas de 24 px de alto para
   que cada enlace sea un blanco táctil propio. */
html:not(.cv-print):not(.cv-embed) .paper:not(.paper-scaled) .v-contact li {
    min-height: 24px;
    margin-bottom: 0;
}

.v-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.v-chips li {
    padding: 2px 8px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    font-size: 8pt;
}

.v-langs li {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3px;
}

.v-langs li span:last-child {
    color: #9CA3AF;
}

.v-interests {
    display: grid;
    gap: 4px;
}

/* Una por línea con su viñeta delante: así ningún separador queda suelto al final de una línea */
.v-interests li {
    display: flex;
    gap: 8px;
}

.v-interests li::before {
    content: '·';
    flex: none;
    color: #10B981;
    font-weight: 700;
}

.v-main {
    padding: 0.45in 0.42in;
}

.v-main section + section {
    margin-top: 16px;
}

.v-main h2 {
    color: #1D2D44;
}

.v-main h2::after {
    content: '';
    display: block;
    width: 28px;
    height: 3px;
    margin-top: 3px;
    border-radius: 3px;
    background: #10B981;
}

.v-summary p {
    margin: 0;
    color: #374151;
    font-size: 9.5pt;
}

.v-entry {
    margin-bottom: 10px;
}

.v-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
}

.v-entry h3 {
    margin: 0;
    color: #111827;
    font-size: 10pt;
    font-weight: 700;
}

.v-date {
    flex-shrink: 0;
    color: #6B7280;
    font-size: 8.5pt;
    font-weight: 700;
}

.v-stack {
    margin: 1px 0 3px;
    color: #047857;
    font-size: 8.5pt;
    font-weight: 700;
}

.v-main ul {
    margin-left: 14px;
    color: #374151;
}

.v-main li {
    margin-bottom: 2px;
}

.v-main li::marker {
    color: #10B981;
}

.v-certs {
    margin-left: 0 !important;
    list-style: none;
}

.v-certs li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 4px;
}

/* ==========================================================================
   Modos sin sitio alrededor: generación de PDF, vista previa del admin e impresión
   ========================================================================== */
@page {
    size: letter;
    margin: 0;
}

.cv-print body,
.cv-embed body {
    min-height: 0;
    background: #FFFFFF;
}

.cv-print .cv-main,
.cv-embed .cv-main {
    padding: 0;
    background: transparent;
}

.cv-print .cv-stage {
    width: 8.5in;
    margin: 0;
}

.cv-print .paper {
    box-shadow: none;
}

.cv-embed body {
    background: #E5E7EB;
}

.cv-embed .cv-stage {
    width: calc(100% - 24px);
    margin: 12px auto;
}

@media print {
    body {
        background: #FFFFFF !important;
    }

    [data-layout],
    .skip-link,
    .cv-hero,
    .cv-credentials,
    .cred-lightbox {
        display: none !important;
    }

    .cv-main {
        padding: 0 !important;
        background: transparent !important;
    }

    .cv-stage {
        width: 8.5in !important;
        margin: 0 !important;
    }

    .cv-scale {
        height: auto !important;
    }

    .paper {
        transform: none !important;
        box-shadow: none !important;
    }

    .paper a.cv-project-link {
        color: inherit;
        text-decoration: none;
    }

    .cv-visual {
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
}

/* ---------- Enlace del nombre de proyecto (solo en la web; en el PDF no hay enlaces) ---------- */
.paper .cv-project-link {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: rgba(17, 24, 39, 0.35);
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: text-decoration-color 0.2s ease, color 0.2s ease;
}

.paper .cv-project-link:hover,
.paper .cv-project-link:focus-visible {
    color: #047857;
    text-decoration-color: currentColor;
}

.paper .cv-project-link:focus-visible {
    outline: 2px solid #047857;
    outline-offset: 2px;
    border-radius: 2px;
}

.paper .cv-project-link:active {
    color: #047857;
}

/* ---------- Certificaciones, diplomas y participaciones (solo web, no entra en la hoja ni en el PDF) ---------- */
.cv-credentials {
    width: min(100% - 40px, 1100px);
    margin: 72px auto 0;
}

.cv-credentials[hidden] {
    display: none;
}

.cv-credentials h2 {
    margin: 0 0 28px;
    color: var(--text-primary);
    font-family: var(--font-heading);
    letter-spacing: var(--tracking-heading);
}

.cv-credentials-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.cred-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 16px;
    border: 1px solid var(--border-card);
    border-radius: var(--radius-card);
    background: var(--surface-card);
}

.cred-media {
    display: grid;
    gap: 8px;
}

.cred-media.is-multiple {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cred-thumb {
    aspect-ratio: 4 / 3;
    border-radius: var(--radius-inner);
}

.cred-zoom {
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: none;
    cursor: zoom-in;
}

.cred-zoom:disabled {
    cursor: default;
}

.cred-zoom img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cred-zoom:focus-visible {
    outline: 2px solid var(--brand-accent);
    outline-offset: -2px;
    border-radius: var(--radius-inner);
}

.cred-zoom:active img {
    opacity: 0.8;
}

.cred-type {
    margin: 0 0 6px;
    color: var(--brand-accent-soft);
    font-size: 0.8rem;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.cred-title {
    margin: 0 0 6px;
    color: var(--text-primary);
    font-size: 1.15rem;
}

.cred-meta {
    margin: 0;
    color: var(--text-muted);
}

.cred-description {
    margin: 10px 0 0;
    color: var(--text-secondary);
}

/* Imagen ampliada: <dialog> a pantalla completa, igual que en las páginas de proyecto */
.cred-lightbox {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 24px;
    border: 0;
    background: transparent;
    cursor: zoom-out;
}

.cred-lightbox[open] {
    display: grid;
    place-items: center;
}

.cred-lightbox::backdrop {
    background: rgba(0, 0, 0, 0.92);
}

.cred-figure {
    display: grid;
    justify-items: center;
    gap: 12px;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
}

.cred-figure img {
    max-width: 100%;
    max-height: calc(100vh - 120px);
    border-radius: var(--radius-inner);
    object-fit: contain;
    cursor: default;
}

.cred-figure figcaption,
.cred-lightbox-error {
    color: var(--text-secondary);
    text-align: center;
}

.cred-lightbox-error {
    margin: 0;
    padding: 48px 24px;
}

.cred-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 48px;
    height: 48px;
    border: 1px solid var(--border-card);
    border-radius: 50%;
    background: rgba(13, 14, 21, 0.8);
    color: var(--text-primary);
    font-size: 1.8rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.cred-close:hover,
.cred-close:focus-visible {
    color: var(--brand-accent);
    border-color: var(--brand-accent);
}

.cred-close:active {
    color: var(--brand-accent);
}

/* Skeleton de la hoja mientras llegan los datos: silueta de un CV (nombre, datos y cuatro secciones).
   Los bloques usan % de la hoja, así que la misma silueta sirve en escritorio y en móvil. */
.paper.skel {
    --skel-base: #EEF0F3;
    --skel-shine: #FFFFFF;
    background-color: var(--skel-base);
}

.paper.skel::before {
    content: '';
    position: absolute;
    inset: 0;
    background-repeat: no-repeat;
    background-image:
        linear-gradient(rgba(17, 24, 39, 0.13), rgba(17, 24, 39, 0.13)),
        linear-gradient(rgba(17, 24, 39, 0.07), rgba(17, 24, 39, 0.07)),
        linear-gradient(rgba(17, 24, 39, 0.07), rgba(17, 24, 39, 0.07)),
        linear-gradient(rgba(17, 24, 39, 0.13), rgba(17, 24, 39, 0.13)),
        linear-gradient(rgba(17, 24, 39, 0.13), rgba(17, 24, 39, 0.13)),
        linear-gradient(rgba(17, 24, 39, 0.07), rgba(17, 24, 39, 0.07)),
        linear-gradient(rgba(17, 24, 39, 0.07), rgba(17, 24, 39, 0.07)),
        linear-gradient(rgba(17, 24, 39, 0.07), rgba(17, 24, 39, 0.07)),
        linear-gradient(rgba(17, 24, 39, 0.07), rgba(17, 24, 39, 0.07)),
        linear-gradient(rgba(17, 24, 39, 0.13), rgba(17, 24, 39, 0.13)),
        linear-gradient(rgba(17, 24, 39, 0.07), rgba(17, 24, 39, 0.07)),
        linear-gradient(rgba(17, 24, 39, 0.07), rgba(17, 24, 39, 0.07)),
        linear-gradient(rgba(17, 24, 39, 0.07), rgba(17, 24, 39, 0.07)),
        linear-gradient(rgba(17, 24, 39, 0.07), rgba(17, 24, 39, 0.07)),
        linear-gradient(rgba(17, 24, 39, 0.13), rgba(17, 24, 39, 0.13)),
        linear-gradient(rgba(17, 24, 39, 0.07), rgba(17, 24, 39, 0.07)),
        linear-gradient(rgba(17, 24, 39, 0.07), rgba(17, 24, 39, 0.07)),
        linear-gradient(rgba(17, 24, 39, 0.07), rgba(17, 24, 39, 0.07)),
        linear-gradient(rgba(17, 24, 39, 0.07), rgba(17, 24, 39, 0.07)),
        linear-gradient(rgba(17, 24, 39, 0.13), rgba(17, 24, 39, 0.13)),
        linear-gradient(rgba(17, 24, 39, 0.07), rgba(17, 24, 39, 0.07)),
        linear-gradient(rgba(17, 24, 39, 0.07), rgba(17, 24, 39, 0.07)),
        linear-gradient(rgba(17, 24, 39, 0.07), rgba(17, 24, 39, 0.07));
    background-size: 42% 2.8%, 30% 1.4%, 62% 1.2%, 84% 0.2%, 22% 1.6%, 84% 1.2%, 78% 1.2%, 82% 1.2%, 50% 1.2%, 22% 1.6%, 84% 1.2%, 78% 1.2%, 82% 1.2%, 50% 1.2%, 22% 1.6%, 84% 1.2%, 78% 1.2%, 82% 1.2%, 50% 1.2%, 22% 1.6%, 84% 1.2%, 78% 1.2%, 82% 1.2%;
    background-position: 13.793% 5.144%, 11.429% 9.331%, 21.053% 11.943%, 50% 14.529%, 10.256% 17.785%, 50% 21.255%, 36.364% 24.291%, 44.444% 27.328%, 16% 30.364%, 10.256% 41.159%, 50% 44.534%, 36.364% 47.571%, 44.444% 50.607%, 16% 53.644%, 10.256% 63.516%, 50% 66.802%, 36.364% 69.838%, 44.444% 72.874%, 16% 75.911%, 10.256% 82.825%, 50% 86.032%, 36.364% 89.069%, 44.444% 92.105%;
}

/* Pantallas más angostas que la hoja: ocupa el ancho disponible con la misma proporción de carta */
@media (max-width: 856px) {
    .paper.skel {
        width: 100%;
        min-height: 0;
        aspect-ratio: 8.5 / 11;
    }
}

/* ---------- Hoja en una columna (pantallas angostas) ----------
   Solo en pantalla: el PDF y la impresión usan la hoja carta de siempre. */
@media screen and (max-width: 856px) {
    .paper.paper-fluid {
        width: 100%;
        min-height: 0;
    }

    .paper-fluid .cv-visual {
        grid-template-columns: minmax(0, 1fr);
        min-height: 0;
        font-size: 1rem;
        line-height: 1.55;
        overflow-wrap: anywhere;
    }

    .paper-fluid .v-side,
    .paper-fluid .v-main {
        padding: 28px 20px;
    }

    .paper-fluid .v-side h1 {
        font-size: 1.7rem;
    }

    .paper-fluid .v-side h2,
    .paper-fluid .v-main h2 {
        font-size: 1.15rem;
    }

    .paper-fluid .v-side h3,
    .paper-fluid .v-location,
    .paper-fluid .v-chips li,
    .paper-fluid .v-date,
    .paper-fluid .v-stack {
        font-size: 0.85rem;
    }

    .paper-fluid .v-summary p,
    .paper-fluid .v-entry h3,
    .paper-fluid .v-contact li {
        font-size: 1rem;
    }

    .paper-fluid .v-contact a {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        text-decoration: underline;
        text-underline-offset: 3px;
    }

    .paper-fluid .v-contact li {
        margin-bottom: 0;
    }

    .paper-fluid .v-row {
        flex-wrap: wrap;
        gap: 2px 12px;
    }

    .paper-fluid .cv-project-link {
        display: inline-block;
        padding: 4px 0;
    }

    .paper-fluid .cv-harvard {
        padding: 24px 18px;
        font-size: 1.05rem;
        line-height: 1.5;
        overflow-wrap: anywhere;
    }

    .paper-fluid .h-head h1 {
        font-size: 1.6rem;
    }

    .paper-fluid .h-head p,
    .paper-fluid .cv-harvard h2 {
        font-size: 0.95rem;
    }

    .paper-fluid .h-row {
        flex-wrap: wrap;
        gap: 0 12px;
    }

    .paper-fluid .h-row span {
        flex-shrink: 1;
        text-align: left;
    }
}
