/* =============================================
   ALUMNI UPM — Hoja de estilos personalizada
   Inspiración: WordPress Kentwood theme
   Tipografía: Montserrat (alternativa web Avenir)
   Colores corporativos del manual de identidad
   ============================================= */

/* ---- Variables de marca ---- */
:root {
    --upm-blue: #0051FF;
    --upm-blue-dark: #00359C;
    --upm-blue-intense: #003EFF;
    --upm-gray: #706F6F;
    --upm-gray-dark: #575756;
    --upm-white: #FFFFFF;
    --upm-gray-light: #F4F6F9;
    --upm-gray-ultra-light: #FAFBFD;
}

/* ---- Tipografía base ---- */
body {
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #1a1a2e;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* ---- Header: estados transparente y sólido ---- */
.header-transparent {
    background: transparent;
    backdrop-filter: none;
}

.header-solid {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

/* Logo: blanco en transparente, color en sólido */
.header-transparent .logo-blanco { display: block; }
.header-transparent .logo-color  { display: none; }
.header-solid .logo-blanco      { display: none; }
.header-solid .logo-color       { display: block; }

/* Footer logo: contenedor blanco para el logo en color */
.footer-logo-img {
    /* sin filtros */
}

/* ---- Navegación ---- */
.nav-link {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgba(255, 255, 255, 0.85);
    transition: color 0.3s ease;
    padding: 0.5rem 0;
    position: relative;
}

/* En header sólido (blanco): texto oscuro */
.header-solid .nav-link {
    color: #1a1a2e;
}

.header-solid .nav-link:hover {
    color: var(--upm-blue);
}

/* Botón hamburguesa: blanco sobre transparente, oscuro sobre sólido */
#mobile-toggle {
    color: #fff;
}

.header-solid #mobile-toggle {
    color: #1a1a2e;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--upm-blue);
    transition: width 0.3s ease;
}

.nav-link:hover {
    color: #fff;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* ---- Dropdown menu ---- */
.dropdown-menu {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.dropdown-item {
    display: block;
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #1a1a2e;
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: var(--upm-blue);
    color: #fff;
    padding-left: 1.5rem;
}

.nav-dropdown:hover .dropdown-menu,
.nav-dropdown:focus-within .dropdown-menu {
    opacity: 1;
    visibility: visible;
}

/* ---- Botón Únete (CTA header) ---- */
/* Botón Únete por defecto (header transparente sobre hero) */
.btn-join {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(8px);
    box-shadow: none;
}

.btn-join:hover {
    background: #fff;
    color: var(--upm-blue-dark);
}

/* Cuando el header es sólido (blanco) */
.header-solid .btn-join {
    background: var(--upm-blue);
    color: #fff;
    border: none;
}

.header-solid .btn-join:hover {
    background: var(--upm-blue-dark);
    color: #fff;
}

/* ---- Hero section ---- */
.hero-section {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 53, 156, 0.85) 0%, rgba(0, 81, 255, 0.55) 50%, rgba(0, 0, 0, 0.3) 100%);
    z-index: 1;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: clamp(2.5rem, 6vw, 5rem);
    font-weight: 800;
    line-height: 1.05;
    color: #fff;
    letter-spacing: -0.03em;
}

.hero-subtitle {
    font-size: clamp(1.125rem, 2vw, 1.5rem);
    color: rgba(255, 255, 255, 0.85);
    font-weight: 400;
    line-height: 1.6;
}

/* ---- Section headings (estilo editorial Kentwood) ---- */
.section-eyebrow {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--upm-blue);
    margin-bottom: 1rem;
}

.section-title {
    font-size: clamp(1.75rem, 4vw, 3rem);
    font-weight: 700;
    line-height: 1.15;
    color: #1a1a2e;
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--upm-gray);
    line-height: 1.7;
    max-width: 50rem;
}

/* ---- Cards de servicios y carreras ---- */
.service-card {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(0, 0, 0, 0.04);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--upm-blue);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s ease;
}

.service-card:hover {
    box-shadow: 0 20px 60px rgba(0, 53, 156, 0.12);
    transform: translateY(-4px);
}

.service-card:hover::before {
    transform: scaleX(1);
}

.service-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--upm-blue);
    opacity: 0.15;
    line-height: 1;
    margin-bottom: 1rem;
}

.service-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 0.5rem;
}

.service-desc {
    font-size: 0.875rem;
    color: var(--upm-gray);
    line-height: 1.6;
}

/* ---- Carreras cards con imagen ---- */
.career-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 4/5;
    cursor: pointer;
    transition: all 0.4s ease;
}

.career-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.career-card:hover img {
    transform: scale(1.08);
}

.career-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 53, 156, 0.95) 0%, rgba(0, 53, 156, 0.3) 50%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1.75rem;
    transition: background 0.4s ease;
}

.career-card:hover .career-overlay {
    background: linear-gradient(to top, rgba(0, 53, 156, 0.98) 0%, rgba(0, 81, 255, 0.5) 60%, rgba(0, 81, 255, 0.1) 100%);
}

.career-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.5rem;
}

.career-desc {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.career-card:hover .career-desc {
    max-height: 100px;
}

/* ---- Eventos cards ---- */
.event-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.event-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.event-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: var(--upm-gray-light);
}

.event-date-badge {
    display: inline-block;
    background: var(--upm-blue);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ---- Noticias cards ---- */
.news-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.news-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.news-image {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background: var(--upm-gray-light);
}

.news-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1a1a2e;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.news-excerpt {
    font-size: 0.875rem;
    color: var(--upm-gray);
    line-height: 1.6;
}

/* ---- Social media cards ---- */
.social-card {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.social-card:hover {
    background: var(--upm-blue);
    color: #fff;
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 81, 255, 0.25);
}

.social-card:hover .social-card-title,
.social-card:hover .social-card-desc {
    color: #fff;
}

.social-card-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--upm-gray-light);
    border-radius: 50%;
    transition: background 0.3s ease;
}

.social-card:hover .social-card-icon {
    background: rgba(255, 255, 255, 0.15);
}

.social-card-icon svg {
    width: 28px;
    height: 28px;
    color: var(--upm-blue);
    transition: color 0.3s ease;
}

.social-card:hover .social-card-icon svg {
    color: #fff;
}

.social-card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
}

.social-card-desc {
    font-size: 0.875rem;
    color: var(--upm-gray);
    transition: color 0.3s ease;
}

/* ---- Social links footer ---- */
.social-icon-footer {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: rgba(255, 255, 255, 0.7);
    transition: all 0.3s ease;
}

.social-icon-footer:hover {
    background: var(--upm-blue);
    color: #fff;
    transform: translateY(-2px);
}

/* ---- Comunidad cards ---- */
.comunidad-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.comunidad-card:hover {
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

.comunidad-image {
    width: 100%;
    height: 240px;
    object-fit: cover;
}

/* ---- Buttons ---- */
.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--upm-blue);
    color: #fff;
    padding: 0.875rem 2rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-primary:hover {
    background: var(--upm-blue-dark);
    color: #fff;
    box-shadow: 0 8px 24px rgba(0, 81, 255, 0.3);
    transform: translateY(-1px);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    border: 2px solid var(--upm-blue);
    color: var(--upm-blue);
    padding: 0.875rem 2rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn-outline:hover {
    background: var(--upm-blue);
    color: #fff;
}

/* ---- Section divider ---- */
.section-divider {
    width: 60px;
    height: 3px;
    background: var(--upm-blue);
    margin: 1.5rem 0;
    border-radius: 2px;
}

/* ---- Scroll indicator ---- */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 3;
    color: rgba(255, 255, 255, 0.6);
    animation: bounce 2s infinite;
    pointer-events: auto;
    cursor: pointer;
    transition: color 0.3s ease;
}
.scroll-indicator:hover {
    color: #fff;
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(10px); }
}

/* ---- Animaciones de entrada ---- */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    .hero-section {
        min-height: 90vh;
    }

    .service-card,
    .social-card {
        padding: 1.5rem;
    }
}

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* ---- Focus visible (accesibilidad) ---- */
*:focus-visible {
    outline: 3px solid var(--upm-blue);
    outline-offset: 2px;
}

/* ---- Skip link ---- */
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--upm-blue);
    color: #fff;
    padding: 0.5rem 1rem;
    z-index: 100;
    transition: top 0.3s ease;
}

.skip-link:focus {
    top: 0;
}

/* ---- Admin panel styles ---- */
.admin-header {
    background: var(--upm-blue-dark);
    color: #fff;
    padding: 1rem 0;
}

.admin-card {
    background: #fff;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 1rem;
}

.admin-input {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.admin-input:focus {
    border-color: var(--upm-blue);
    box-shadow: 0 0 0 3px rgba(0, 81, 255, 0.1);
    outline: none;
}

.admin-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.375rem;
}

.admin-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    transition: all 0.2s;
    text-decoration: none;
    border: none;
    cursor: pointer;
}

.admin-btn-primary {
    background: var(--upm-blue);
    color: #fff;
}

.admin-btn-primary:hover {
    background: var(--upm-blue-dark);
}

.admin-btn-danger {
    background: #ef4444;
    color: #fff;
}

.admin-btn-danger:hover {
    background: #dc2626;
}

.admin-btn-edit {
    background: #f3f4f6;
    color: #374151;
}

.admin-btn-edit:hover {
    background: #e5e7eb;
}
