@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500&family=Jost:wght@400;500;600&display=swap');

* {
    box-sizing: border-box;
}

body {
    /* 🟢 Variables CSS conectadas */
    color: var(--dc-text, #2b2c48);
    font-family: "Jost", sans-serif;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    min-height: 100vh;
    display: flex;
    flex-wrap: wrap;
    padding: 20px;
    transition: background-image 0.5s ease-in-out;
}

.card {
    width: 100%;
    max-width: 340px;
    margin: auto;
    position: relative;
    z-index: 1;
    overflow-x: hidden;
    /* 🟢 Fondo variable */
    background-color: var(--dc-bg, #ffffff);
    display: flex;
    transition: 0.3s;
    flex-direction: column;
    border-radius: 10px;
    box-shadow: 0 0 0 8px rgba(255, 255, 255, 0.2);
    height: 450px;
    border: 0 !important;
}

.card.is-active {
    height: 500px;
}

.card-main {
    padding-top: 0;
}

.card-header {
    border-bottom: 0 !important;
}

.card.is-active .card-header {
    height: 80px;
}

.card.is-active .card-cover {
    height: 100px;
    top: -50px;
}

.card.is-active .card-avatar {
    transform: none;
    left: 20px;
    width: 50px;
    height: 50px;
    bottom: 10px;
}

/* =========================================================================
   [GRUPO 2: CABECERA EN PESTAÑAS - ALINEACIÓN LATERAL Y CONTROL DE DESBORDE]
   ========================================================================= */
.card.is-active .card-fullname,
.card.is-active .card-jobtitle {
    left: 80px;
    transform: none;
    width: calc(100% - 130px);
    max-width: calc(100% - 130px);
    text-align: left;
}

.card.is-active .card-fullname {
    bottom: 34px;
    font-size: 16px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card.is-active .card-jobtitle {
    bottom: 14px;
    letter-spacing: 1px;
    font-size: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-header {
    position: relative;
    display: flex;
    height: 200px;
    flex-shrink: 0;
    width: 100%;
    transition: 0.3s;
}

.card-header * {
    transition: 0.3s;
}

.card-cover {
    width: 100%;
    height: 100%;
    position: absolute;
    top: -20%;
    left: 0;
    will-change: top;
    background-size: cover;
    background-position: center;
    filter: blur(30px);
    transform: scale(1.2);
    transition: background-image 0.5s ease-in-out, top 0.5s ease-in-out;
}

.card-avatar {
    width: 100px;
    height: 100px;
    box-shadow: 0 8px 8px rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    object-position: center;
    object-fit: cover;
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) translateY(-64px);
    transition: all 0.3s ease;
}

/* =========================================================================
   [GRUPO 1: CABECERA INICIAL - SALTO DE RENGLÓN Y SEPARACIÓN VERTICAL]
   ========================================================================= */
.card-fullname {
    position: absolute;
    bottom: 28px;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
    white-space: normal;
    overflow-wrap: break-word;
    line-height: 1.2;
    width: 90%;
    max-width: 90%;
    left: 50%;
    transform: translateX(-50%);
    transition: all 0.3s ease;
}

.card-jobtitle {
    position: absolute;
    bottom: 8px;
    font-size: 11px;
    white-space: normal;
    overflow-wrap: break-word;
    font-weight: 500;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
    line-height: 1.25;
    width: 90%;
    max-width: 90%;
    margin: 0;
    left: 50%;
    transform: translateX(-50%);
    transition: all 0.3s ease;
}

.card-main {
    position: relative;
    flex: 1;
    display: flex;
    padding-top: 10px;
    flex-direction: column;
}

.card-subtitle {
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 8px;
}

.card-content {
    padding: 20px;
}

.card-desc {
    line-height: 1.5;
    /* 🟢 Suavizado de color */
    color: var(--dc-text, #636b6f);
    opacity: 0.8;
    font-size: 14px;
    margin: 0;
    font-weight: 400;
    font-family: "DM Sans", sans-serif;
    transition: all 0.3s ease;
}

.card-social {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 0 20px;
    margin-bottom: 30px;
}

.card-social svg {
    /* 🟢 Ícono variable */
    fill: var(--dc-icon, #a5b5ce);
    width: 16px;
    display: block;
    transition: 0.3s;
}

.card-social a {
    color: #8797a1;
    height: 32px;
    width: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s;
    background-color: rgba(93, 133, 193, 0.05);
    border-radius: 50%;
    margin: 5px;
    text-decoration: none;
}

.card-social a:hover svg {
    /* 🟢 Hover variable */
    fill: var(--dc-btn-bg, #637faa);
}

.card-buttons {
    display: flex;
    background-color: var(--dc-bg, #ffffff);
    margin-top: auto;
    position: sticky;
    bottom: 0;
    left: 0;
    overflow-x: auto;
    white-space: nowrap;
    flex-wrap: nowrap;
    scrollbar-width: none;
    border-radius: 0 0 10px 10px;
}

.card-buttons::-webkit-scrollbar {
    display: none;
}

.card-buttons button {
    flex: 1 1 auto;
    user-select: none;
    background: 0;
    font-size: 13px;
    border: 0;
    padding: 15px 15px;
    cursor: pointer;
    /* 🟢 Color Base */
    color: var(--dc-text, #5c5c6d);
    opacity: 0.6;
    transition: 0.3s;
    font-family: "Jost", sans-serif;
    font-weight: 500;
    outline: 0;
    border-bottom: 3px solid transparent;
}

.card-buttons button.is-active,
.card-buttons button:hover {
    /* 🟢 Color y Borde Variable para el Botón activo */
    color: var(--dc-text, #2b2c48);
    opacity: 1;
    border-bottom: 3px solid var(--dc-btn-bg, #8a84ff);
    background: linear-gradient(to bottom, rgba(127, 199, 231, 0) 0%, rgba(207, 204, 255, 0.05) 44%, rgba(211, 226, 255, 0.2) 100%);
}

/* =========================================================================
   [GRUPO 4: SECCIONES Y PESTAÑAS - CONTENCIÓN HORIZONTAL]
   ========================================================================= */
.card-section {
    display: none;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    max-width: 100%;
}

.card-section::-webkit-scrollbar {
    width: 4px;
}

.card-section::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
}

.card-section.is-active {
    display: block;
    animation: fadeIn 0.6s both;
}

@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translatey(40px);
    }

    100% {
        opacity: 1;
    }
}

.card-contact-wrapper {
    margin-top: 20px;
}

/* =========================================================================
   [GRUPO 3: FILAS DE CONTACTO - TRUNCADO ESTRICTO DE EMAILS Y TEXTOS LARGOS]
   ========================================================================= */
.card-contact {
    display: flex;
    align-items: center;
    font-size: 13px;
    color: var(--dc-text, #6f6f7b);
    font-family: "DM Sans", sans-serif;
    line-height: 1.6;
    cursor: pointer;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
}

.card-contact span {
    min-width: 0;
    flex: 1 1 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-contact+.card-contact {
    margin-top: 16px;
}

.card-contact svg {
    flex-shrink: 0;
    width: 30px;
    min-height: 34px;
    margin-right: 12px;
    transition: 0.3s;
    padding-right: 12px;
    border-right: 1px solid #dfe2ec;
    /* 🟢 Color SVG */
    stroke: var(--dc-icon, currentColor);
}

/* =========================================================================
   [GRUPO 5: ADAPTACIÓN RESPONSIVA ULTRA-COMPACTA (PANTALLAS <= 320px / 280px)]
   ========================================================================= */

@media (max-width: 320px) {

    /* 5.1 Tarjeta y Espacio Exterior: Reducir padding exterior para ganar ancho útil */
    body {
        padding: 10px !important;
    }

    .card {
        max-width: 100% !important;
        height: 485px !important;
    }

    /* 5.2 Cabecera en Reposo: Ganar 45px de altura para acomodar textos largos */
    .card-header {
        height: 245px !important;
    }

    /* 5.3 Avatar: Reducir diámetro a 75px y elevarlo para dejar espacio limpio abajo */
    .card-avatar {
        width: 100px !important;
        height: 100px !important;
        transform: translateX(-50%) translateY(-105px) !important;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2) !important;
    }

    /* 5.4 Nombre Completo: Posicionado entre la base de la foto y el cargo */
    .card-fullname {
        bottom: 50px !important;
        font-size: 16px !important;
        line-height: 1.2 !important;
        width: 92% !important;
        max-width: 92% !important;
    }

    /* 5.5 Cargo y Empresa: Descendido hacia la base inferior sin tocar la foto */
    .card-jobtitle {
        bottom: 8px !important;
        font-size: 9.5px !important;
        letter-spacing: 0.8px !important;
        line-height: 1.2 !important;
        width: 92% !important;
        max-width: 92% !important;
    }

    /* 5.6 Cabecera Activa (Al pulsar una pestaña): Compactación lateral extrema */
    .card.is-active .card-header {
        height: 75px !important;
    }

    .card.is-active .card-avatar {
        width: 42px !important;
        height: 42px !important;
        left: 12px !important;
        bottom: 8px !important;
    }

    .card.is-active .card-fullname,
    .card.is-active .card-jobtitle {
        left: 62px !important;
        width: calc(100% - 105px) !important;
        max-width: calc(100% - 105px) !important;
    }

    .card.is-active .card-fullname {
        bottom: 28px !important;
        font-size: 14px !important;
    }

    .card.is-active .card-jobtitle {
        bottom: 10px !important;
        font-size: 9px !important;
    }

    /* 5.7 Botones de Navegación Inferior: Ajuste de padding para evitar saltos */
    .card-buttons button {
        padding: 12px 10px !important;
        font-size: 12px !important;
    }
}