/* Tipografía institucional */
body {
    margin: 0;
    font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    background: #f5f6f7;
    color: #1a1a1a;
    line-height: 1.6;
}

html {
    scroll-behavior: smooth;
}

/* Encabezado */
.header {
    background: #0a2342;
    color: white;
    padding: 40px 20px;
    border-bottom: 4px solid #1b3a61;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap; /* RESPONSIVE */
}

.profile-photo {
    width: 140px;
    height: 140px;
    border-radius: 6px;
    object-fit: cover;
    border: 3px solid #1b3a61;
}

.header-text {
    max-width: 600px;
    text-align: center; /* RESPONSIVE */
}

.title {
    margin: 0;
    font-size: 30px;
    font-weight: 600;
}

.subtitle {
    margin-top: 8px;
    font-size: 15px;
    opacity: 0.9;
}

.subtitle-small {
    font-size: 14px;
    opacity: 0.85;
    margin-top: 6px;
}

/* Navegación */
.nav {
    margin-top: 25px;
    text-align: center;
    flex-wrap: wrap;
}

.nav a {
    color: white;
    margin: 0 12px;
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
}

.nav a:hover {
    text-decoration: underline;
}

/* Secciones */
.section {
    max-width: 900px;
    margin: 46px auto;
    padding: 0 20px;
}

.section-title {
    font-size: 24px;
    font-weight: 600;
    color: #0a2342;
    border-left: 5px solid #1b3a61;
    padding-left: 12px;
    margin-bottom: 25px;
    letter-spacing: 0.5px;
}

/* Tarjetas institucionales */
.card {
    background: white;
    padding: 30px;
    border-radius: 6px;
    border: 1px solid #d9d9d9;
    margin-bottom: 30px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: #0a2342;
    margin-bottom: 15px;
}

/* Texto y listas */
.text, .list li {
    font-size: 16px;
    line-height: 1.7;
    color: #1a1a1a;
}

.list {
    padding-left: 20px;
}

.list li {
    margin-bottom: 10px;
}

.contact-list {
    display: grid;
    gap: 14px;
}

.contact-item {
    display: grid;
    grid-template-columns: 44px minmax(90px, 120px) 1fr;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border: 1px solid #d9e2ec;
    border-radius: 10px;
    background: linear-gradient(135deg, #ffffff, #f7fafc);
    color: #0a2342;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.contact-item:hover {
    transform: translateY(-1px);
    border-color: #1b3a61;
    box-shadow: 0 6px 18px rgba(10, 35, 66, 0.1);
}

.contact-icon {
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: #0a2342;
    color: #ffffff;
}

.contact-icon svg {
    width: 20px;
    height: 20px;
}

.contact-label {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #1b3a61;
}

.contact-value {
    font-size: 16px;
    word-break: break-word;
}

/* Botón volver al menú */
.section-back {
    margin-top: 2px;
    display: flex;
    justify-content: flex-end;
}

.back-to-menu {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1px solid #1b3a61;
    background: linear-gradient(135deg, #ffffff, #eef3f8);
    color: #0a2342;
    text-decoration: none;
    font-size: clamp(13px, 1.5vw, 14px);
    font-weight: 600;
    line-height: 1.2;
    max-width: 100%;
    min-height: 42px;
    box-sizing: border-box;
    white-space: normal;
    text-align: center;
    box-shadow: 0 2px 8px rgba(10, 35, 66, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.back-to-menu::before {
    content: "↑";
    font-size: 14px;
    line-height: 1;
}

.back-to-menu:hover {
    background: linear-gradient(135deg, #f9fcff, #dbe7f3);
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(10, 35, 66, 0.16);
}

.back-to-menu:active {
    transform: translateY(0);
}

/* Botón CV */
.cv-download {
    margin-top: 20px;
}

.btn {
    background: #0a2342;
    color: white;
    padding: 12px 20px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    display: inline-block;
}

.btn:hover {
    background: #1b3a61;
}

/* Pie de página */
.footer {
    background: #0a2342;
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 60px;
    font-size: 14px;
}

/* ----------------------------- */
/* 📱 RESPONSIVE DESIGN */
/* ----------------------------- */

/* Tablets y pantallas medianas */
@media (max-width: 900px) {
    .title {
        font-size: 26px;
    }

    .profile-photo {
        width: 120px;
        height: 120px;
    }

    .nav a {
        margin: 8px;
        display: inline-block;
    }

    .back-to-menu {
        padding: 8px 14px;
        font-size: 13px;
        min-height: 36px;
    }
}

/* Teléfonos grandes */
@media (max-width: 600px) {
    .header-container {
        flex-direction: column;
        text-align: center;
    }

    .profile-photo {
        width: 110px;
        height: 110px;
    }

    .title {
        font-size: 24px;
    }

    .section {
        margin: 32px auto;
    }

    .card {
        padding: 22px;
    }

    .contact-item {
        grid-template-columns: 44px 1fr;
    }

    .contact-label,
    .contact-value {
        grid-column: 2;
    }

    .contact-label {
        margin-bottom: -8px;
    }

    .back-to-menu {
        width: 100%;
        max-width: 260px;
        padding: 8px 12px;
        font-size: 12px;
        min-height: 34px;
    }
}

/* Teléfonos pequeños */
@media (max-width: 400px) {
    .title {
        font-size: 20px;
    }

    .subtitle {
        font-size: 13px;
    }

    .nav a {
        font-size: 13px;
        margin: 5px;
    }

    .profile-photo {
        width: 95px;
        height: 95px;
    }

    .back-to-menu {
        width: 100%;
        padding: 7px 10px;
        font-size: 12px;
        min-height: 32px;
    }
}
