/* ===== VARIABLES CSS (Estilo Fundación MSI) ===== */
:root {
    /* Colores exactos del sitio principal Fundación MSI */
    --e-global-color-primary: #009FDA;
    --e-global-color-secondary: #858585;
    --e-global-color-text: #283573;
    --brand-primary: #009FDA;
    --brand-secondary: #858585;
    --brand-dark: #283573;
    --brand-light: #e6f7ff;
    --ink: #283573;
    --muted: #858585;
    --bg: #fff;
    --chip: #e6f7ff;
    --card: #fff;
    --ring: 0 0 0 4px rgba(0, 159, 218, 0.2);
    --border: #e9eef5;
    --border-light: #e6ebf2;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.15);
    --msi-blue: #009FDA;
    --msi-light-blue: #e6f7ff;
    --msi-dark-blue: #283573;
}

/* ===== RESET Y BASE ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Montserrat', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--e-global-color-text);
    line-height: 1.6;
    overflow-x: hidden;
}

/* ===== UTILIDADES ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===== HEADER (Estilo Fundación MSI) ===== */
.header {
    background: var(--msi-blue);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.brand img {
    height: 40px;
    transition: transform 0.3s ease;
}

.brand img:hover {
    transform: scale(1.05);
}

.nav {
    display: flex;
    gap: 2rem;
    align-items: center;
    flex-wrap: wrap;
}

.nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 4px;
}

.nav a:hover {
    background: rgba(255, 255, 255, 0.1);
    opacity: 0.9;
}

/* ===== HERO SECTION (Estilo Fundación MSI) ===== */
.hero {
    padding: 3rem 0 2rem;
    text-align: center;
    /* background: linear-gradient(135deg, var(--msi-light-blue) 0%, #f8f9fa 100%); */
    margin-bottom: 2rem;
}

h1 {
    font-family: 'Sanchez', Georgia, 'Times New Roman', serif;
    font-size: clamp(2rem, 4vw, 3rem);
    color: var(--e-global-color-primary);
    line-height: 1.2;
    margin: 0 0 1rem;
    font-weight: 700;
}

.hero-subtitle {
    max-width: 800px;
    margin: 0 auto;
}

.hero-subtitle h2 {
    font-family: 'Sanchez', Georgia, 'Times New Roman', serif;
    font-size: 1.5rem;
    color: var(--e-global-color-text);
    margin-bottom: 1rem;
    font-weight: 600;
}

.hero-subtitle p {
    color: var(--e-global-color-secondary);
    font-size: 1.1rem;
    line-height: 1.7;
}

/* ===== BREADCRUMB ===== */
.breadcrumb {
    background: #f8f9fa;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 2rem;
}

.breadcrumb-list {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    align-items: center;
}

.breadcrumb-item:not(:last-child)::after {
    content: '/';
    margin-left: 0.5rem;
    color: var(--e-global-color-secondary);
}

.breadcrumb-item a {
    color: var(--e-global-color-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-item a:hover {
    color: var(--e-global-color-primary);
}

.breadcrumb-item[aria-current="page"] {
    color: var(--e-global-color-text);
    font-weight: 500;
}

/* ===== FILTROS (Estilo Fundación MSI) ===== */
.filters-section {
    margin-bottom: 3rem;
    text-align: center;
}

.filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    background: var(--e-global-color-primary);
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    color: white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    min-width: 140px;
    justify-content: center;
    text-decoration: none;
    user-select: none;
}

.filter-btn:hover {
    background: var(--e-global-color-text);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.filter-btn.active {
    background: var(--e-global-color-text);
    color: white;
    transform: translateY(-1px);
    position: relative;
}

.search-container {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border-radius: 25px;
    border: 2px solid var(--border-light);
    font-size: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--e-global-color-primary);
    box-shadow: 0 0 0 3px rgba(0, 159, 218, 0.1);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--e-global-color-secondary);
    pointer-events: none;
}

/* ===== GRID DE TESTIMONIOS (Estilo CDC) ===== */
.section {
    padding: 2rem 0;
}

.testimonios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

@media (max-width: 768px) {
    .testimonios-grid {
        grid-template-columns: 1fr;
    }
}

.testimonio-card {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.testimonio-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--e-global-color-primary);
}

.testimonio-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--e-global-color-primary);
}

.testimonio-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.testimonio-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--msi-light-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.testimonio-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.testimonio-info h3 {
    font-family: 'Sanchez', Georgia, 'Times New Roman', serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--e-global-color-text);
    margin-bottom: 0.25rem;
}

.testimonio-meta {
    font-size: 0.9rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 0.25rem;
}

.category-tag {
    color: var(--e-global-color-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.category-tag:hover {
    color: var(--e-global-color-text);
    transform: translateX(2px);
}

.testimonio-excerpt {
    color: var(--e-global-color-text);
    line-height: 1.6;
    margin-bottom: 1rem;
    font-style: italic;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: calc(1.6em * 5);
    text-align: justify;
}

.testimonio-link {
    background: var(--e-global-color-text);
    color: white;
    padding: 0.2rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    border: 1px solid var(--e-global-color-primary);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.testimonio-link:hover {
    background: var(--e-global-color-primary);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 159, 218, 0.2);
}

/* ===== INFORMACIÓN ADICIONAL (Estilo CDC) ===== */
.info-section {
    /* background: var(--msi-light-blue); */
    padding: 3rem 0;
    margin: 3rem 0;
}

.info-section h2 {
    font-family: 'Sanchez', Georgia, 'Times New Roman', serif;
    text-align: center;
    font-size: 2rem;
    color: var(--e-global-color-primary);
    margin-bottom: 2rem;
    font-weight: 700;
}

.info-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.info-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    text-align: center;
}

.info-card h3 {
    color: var(--e-global-color-primary);
    font-size: 1.3rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.info-card p {
    color: var(--e-global-color-text);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.info-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--e-global-color-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    padding: 0.5rem 0;
}

.info-link:hover {
    color: var(--e-global-color-text);
    transform: translateX(2px);
}

.info-link i {
    font-size: 0.8rem;
}

/* ===== CTA SECTION ===== */
.cta-section {
    background: white;
    color: var(--e-global-color-text);
    padding: 3rem 2rem;
    text-align: center;
    margin: 3rem 0;
    border-radius: 12px;
    border: 2px solid var(--e-global-color-primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.cta-title {
    font-family: 'Sanchez', Georgia, 'Times New Roman', serif;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--e-global-color-text);
}

.cta-description {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    color: var(--e-global-color-primary);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ===== SOCIAL LINKS ===== */
.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 2.25rem;
    border-radius: 9999px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    color: white;
    font-size: 1.05rem;
}

.social-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.social-link.facebook {
    background: var(--msi-blue);
}

.social-link.facebook:hover {
    background: #0087bf;
    box-shadow: 0 4px 12px rgba(0, 159, 218, 0.3);
}

.social-link.instagram {
    background: var(--msi-blue);
}

.social-link.instagram:hover {
    background: #0087bf;
    box-shadow: 0 4px 12px rgba(0, 159, 218, 0.3);
}

.social-link i {
    font-size: 1.2rem;
}

.social-link span {
    font-size: 0.95rem;
}

/* ===== FOOTER (Estilo CDC) ===== */
.footer {
    background: var(--brand-dark);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 3rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--e-global-color-primary);
}

.footer-description {
    line-height: 1.6;
    margin-bottom: 1rem;
    opacity: 0.9;
}

.footer-subtitle {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--e-global-color-primary);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.5rem;
}

.footer-links a {
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
    opacity: 0.9;
}

.footer-links a:hover {
    color: #ffd700;
    opacity: 1;
}

.footer-bottom {
    border-top: 1px solid #34495e;
    padding-top: 1rem;
    text-align: center;
}

.copyright {
    opacity: 0.8;
    font-size: 0.9rem;
}

/* ===== LOADING SPINNER ===== */
.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.loading-spinner.visible {
    opacity: 1;
    visibility: visible;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--e-global-color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== ESTADOS VACÍOS Y ERROR ===== */
.empty-state,
.error-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.empty-state i,
.error-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.empty-state i {
    color: var(--e-global-color-secondary);
}

.error-state i {
    color: #e74c3c;
}

.empty-state h3,
.error-state h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--e-global-color-text);
}

.empty-state p,
.error-state p {
    color: var(--e-global-color-secondary);
    margin-bottom: 1.5rem;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .nav {
        justify-content: center;
    }
    
    .filters {
        flex-direction: column;
        align-items: center;
    }
    
    .filter-btn {
        width: 100%;
        max-width: 250px;
        justify-content: center;
        min-width: auto;
        padding: 0.875rem 1rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
        justify-content: center;
    }
    
    .social-links {
        flex-direction: column;
        align-items: center;
    }
    
    .social-link {
        width: 100%;
        max-width: 250px;
        justify-content: center;
    }
    
    .cta-section {
        padding: 2rem 1rem;
        margin: 2rem 0;
    }
    
    .cta-title {
        font-size: 1.5rem;
    }
    
    .cta-description {
        font-size: 1rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 12px;
    }
    
    .hero {
        padding: 2rem 0;
    }
    
    .testimonio-card {
        padding: 1.5rem;
    }
    
    .info-card {
        padding: 1.5rem;
    }
    
    .cta-section {
        padding: 1.5rem 0.75rem;
        margin: 1.5rem 0;
    }
    
    .cta-title {
        font-size: 1.25rem;
    }
    
    .cta-description {
        font-size: 0.9rem;
    }
    
    .social-link {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }
}

/* ===== ANIMACIONES ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.testimonio-card {
    animation: fadeInUp 0.6s ease forwards;
}

.testimonio-card:nth-child(1) { animation-delay: 0.1s; }
.testimonio-card:nth-child(2) { animation-delay: 0.2s; }
.testimonio-card:nth-child(3) { animation-delay: 0.3s; }
.testimonio-card:nth-child(4) { animation-delay: 0.4s; }
.testimonio-card:nth-child(5) { animation-delay: 0.5s; }
.testimonio-card:nth-child(6) { animation-delay: 0.6s; }

/* ===== ACCESIBILIDAD ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
button:focus,
a:focus,
input:focus,
textarea:focus,
select:focus {
    outline: 2px solid var(--e-global-color-primary);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .testimonio-card {
        border: 2px solid #333;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}

/* Print styles */
@media print {
    .header,
    .filters-section,
    .cta-section,
    .footer {
        display: none;
    }
    
    .testimonios-grid {
        grid-template-columns: 1fr;
    }
    
    .testimonio-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
