/* ==========================================================================
   HUB TESELA - SISTEMA DE DISEÑO Y CUADRÍCULA 
   ========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;600;700;900&family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Paleta Principal Heredada */
    --ed27-navy: #0A2D4D;
    /* Ajustado a tu primary real */
    --ed27-navy-light: #0d172a;
    --ed27-gold: #FFC107;
    /* Ajustado a tu secondary real */
    --ed27-bg-soft: #f1f5f9;
    --ed27-text-main: #475569;
    --ed27-text-title: #0f172a;

    /* Paleta Semántica del Hub Tesela */
    --tesela-investigacion: #1E3A8A;
    --tesela-empresa: #DAA036;
    --tesela-academica: #4CAF9D;
    --tesela-divulgacion: #3699DA;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--ed27-bg-soft);
    margin: 0;
}

.ed27-font-display {
    font-family: 'Montserrat', sans-serif;
    letter-spacing: -0.03em;
}

.text-gradient-gold {
    background: linear-gradient(135deg, #FFC107 0%, #DAA036 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* --- CABECERA (HERO) CLÁSICA --- */
.tesela-hero-section {
    position: relative;
    padding: 8rem 2rem 6rem;
    background-color: var(--ed27-navy);
    text-align: center;
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(10, 45, 77, 0.8) 0%, rgba(10, 45, 77, 0.95) 100%);
    z-index: 1;
}

.tesela-hero-content {
    position: relative;
    z-index: 10;
    max-width: 64rem;
    margin: 0 auto;
}

.ed27-label-title-light {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    color: var(--ed27-gold);
    padding: 6px 16px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-bottom: 1.5rem;
}

.tesela-main-title {
    font-size: clamp(3rem, 8vw, 5.5rem);
    font-weight: 900;
    color: #ffffff;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
}

.tesela-hero-subtitle {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    color: var(--ed27-gold);
    font-weight: 300;
    margin-bottom: 1.5rem;
}

.tesela-hero-text {
    font-size: 1.125rem;
    color: #cbd5e1;
    max-width: 48rem;
    margin: 0 auto;
    line-height: 1.6;
}

/* --- TÍTULO DE SECCIÓN --- */
.tesela-grid-section {
    padding: 6rem 2rem;
    background-color: var(--ed27-bg-soft);
}

.ed27-section-title-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 4rem;
}

.ed27-section-title-block h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 900;
    text-transform: uppercase;
    color: var(--ed27-text-title);
    margin: 0;
}

.ed27-section-title-block .separator {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 1.5rem;
}

.ed27-section-title-block .separator-block {
    height: 8px;
    background-color: var(--ed27-gold);
    border-radius: 4px;
}

.separator-block:nth-child(1) {
    width: 15px;
    opacity: 0.6;
}

.separator-block:nth-child(2) {
    width: 60px;
}

.separator-block:nth-child(3) {
    width: 15px;
    opacity: 0.6;
}

.tesela-section-description {
    margin-top: 1.5rem;
    color: var(--ed27-text-main);
    font-size: 1.125rem;
}

/* --- CUADRÍCULA (GRID) --- */
.tesela-cards-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    max-width: 85rem;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .tesela-cards-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1200px) {
    .tesela-cards-container {
        grid-template-columns: repeat(4, 1fr);
        gap: 2rem;
    }
}

/* --- TARJETAS PREMIUM --- */
.ed27-card {
    background: #ffffff;
    border-radius: 2rem;
    padding: 3rem 2rem;
    text-align: center;
    border: 1px solid #e2e8f0;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    box-sizing: border-box;
}

.ed27-card:hover {
    transform: translateY(-10px) scale(1.02);
}

.ed27-card-icon {
    width: 5rem;
    height: 5rem;
    border-radius: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    transition: all 0.4s ease;
    border: 2px solid transparent;
}

.ed27-card-icon i {
    width: 2.5rem;
    height: 2.5rem;
}

.ed27-card:hover .ed27-card-icon {
    transform: scale(1.05) rotate(5deg);
}

.ed27-card h3 {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--ed27-text-title);
    margin-bottom: 0.75rem;
    font-family: 'Montserrat', sans-serif;
}

.ed27-card p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--ed27-text-main);
    margin: 0;
}

/* --- COLORES SEMÁNTICOS DE LAS TESELAS --- */
.tesela-card-investigacion {
    border-top: 5px solid var(--tesela-investigacion);
}

.tesela-card-investigacion .ed27-card-icon {
    color: var(--tesela-investigacion);
    background-color: rgba(30, 58, 138, 0.05);
}

.tesela-card-investigacion:hover {
    border-color: var(--tesela-investigacion);
    box-shadow: 0 25px 50px -15px rgba(30, 58, 138, 0.2);
}

.tesela-card-investigacion:hover .ed27-card-icon {
    background-color: var(--tesela-investigacion);
    color: #ffffff;
}

.tesela-card-empresa {
    border-top: 5px solid var(--tesela-empresa);
}

.tesela-card-empresa .ed27-card-icon {
    color: var(--tesela-empresa);
    background-color: rgba(218, 160, 54, 0.05);
}

.tesela-card-empresa:hover {
    border-color: var(--tesela-empresa);
    box-shadow: 0 25px 50px -15px rgba(218, 160, 54, 0.2);
}

.tesela-card-empresa:hover .ed27-card-icon {
    background-color: var(--tesela-empresa);
    color: #ffffff;
}

.tesela-card-academica {
    border-top: 5px solid var(--tesela-academica);
}

.tesela-card-academica .ed27-card-icon {
    color: var(--tesela-academica);
    background-color: rgba(76, 175, 157, 0.05);
}

.tesela-card-academica:hover {
    border-color: var(--tesela-academica);
    box-shadow: 0 25px 50px -15px rgba(76, 175, 157, 0.2);
}

.tesela-card-academica:hover .ed27-card-icon {
    background-color: var(--tesela-academica);
    color: #ffffff;
}

.tesela-card-divulgacion {
    border-top: 5px solid var(--tesela-divulgacion);
}

.tesela-card-divulgacion .ed27-card-icon {
    color: var(--tesela-divulgacion);
    background-color: rgba(54, 153, 218, 0.05);
}

.tesela-card-divulgacion:hover {
    border-color: var(--tesela-divulgacion);
    box-shadow: 0 25px 50px -15px rgba(54, 153, 218, 0.2);
}

.tesela-card-divulgacion:hover .ed27-card-icon {
    background-color: var(--tesela-divulgacion);
    color: #ffffff;
}

/* ==========================================================================
   EFECTOS DEL MOSAICO (NUEVO DISEÑO INDEX)
   ========================================================================== */
.pieza-mosaico {
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    position: relative;
    overflow: hidden;
}

.pieza-mosaico:hover {
    transform: scale(0.98);
    filter: brightness(1.1);
    z-index: 10;
}

/* Brillo metálico al pasar el ratón */
.pieza-mosaico::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 50%;
    height: 100%;
    background: linear-gradient(to right, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0) 100%);
    transform: skewX(-25deg);
    transition: 0.7s;
    pointer-events: none;
}

.pieza-mosaico:hover::after {
    left: 200%;
}