/* ==========================================================================
   Especialidades ("¿En qué nos especializamos?") - EXCLUSIVO de
   Pages/Home/Index.razor. No reutilizar estas clases en otras páginas ni
   en otras cards: los componentes compartidos InfoCard/SectionHeader/
   ".sc-card"/".sc-grid" no se tocan y siguen igual en el resto del sitio.
   ========================================================================== */

.specialties-section {
    padding: 88px 0;
    background: var(--background-secondary);
}

.specialties-header {
    text-align: center;
    max-width: 680px;
    margin: 0 auto 52px;
}

.specialties-eyebrow-line {
    width: 56px;
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
    margin: 0 auto 22px;
}

.specialties-title {
    font-size: clamp(1.9rem, 1.4rem + 2vw, 2.6rem);
    color: var(--dark);
    font-weight: 800;
    margin-bottom: 14px;
}

.specialties-subtitle {
    color: var(--text-secondary);
    font-size: 1.05rem;
    margin: 0;
}

.specialties-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

/* Séptima card (Huawei eKit): cierra la cuadrícula como fila destacada de
   ancho completo en vez de quedar sola junto a celdas vacías. */
.specialties-grid .specialty-card:last-child {
    grid-column: 1 / -1;
}

/* ----- Card ----- */
.specialty-card {
    position: relative;
    display: flex;
    min-height: 300px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

    .specialty-card:hover {
        transform: translateY(-4px);
        box-shadow: 0 12px 30px rgba(0, 0, 0, 0.06);
        border-color: rgba(227, 6, 19, 0.25);
    }

    .specialty-card:hover .specialty-card-media img {
        transform: scale(1.03);
    }

.specialty-card-content {
    position: relative;
    z-index: 2;
    width: 58%;
    padding: 32px 26px;
    display: flex;
    flex-direction: column;
}

.specialty-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(227, 6, 19, 0.06);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
}

    .specialty-icon svg {
        width: 20px;
        height: 20px;
    }

.specialty-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
}

.specialty-card-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
    flex: 1;
}

.specialty-link {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text-primary);
    width: fit-content;
    transition: color .2s ease;
}

    .specialty-link:hover {
        color: var(--primary);
    }

        .specialty-link:hover .specialty-link__circle {
            transform: translateX(4px);
            background: var(--primary-hover);
        }

.specialty-link__circle {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform .2s ease, background-color .2s ease;
}

    .specialty-link__circle svg {
        width: 14px;
        height: 14px;
    }

/* ----- Media (illustration) area ----- */
.specialty-card-media {
    position: absolute;
    z-index: 1;
    inset: 0 0 0 auto;
    width: 46%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

    .specialty-card-media::after {
        content: "";
        position: absolute;
        inset: 0;
        z-index: 3;
        background: linear-gradient(to right, var(--background) 0%, rgba(255, 255, 255, 0.85) 16%, rgba(255, 255, 255, 0) 52%);
        pointer-events: none;
    }

    .specialty-card-media img {
        position: relative;
        z-index: 2;
        width: 76%;
        height: auto;
        transition: transform .35s ease;
    }

/* Backdrop variant A: soft red circle glow */
.specialty-card-media--circle::before {
    content: "";
    position: absolute;
    z-index: 1;
    right: -50px;
    width: 230px;
    height: 230px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(227, 6, 19, 0.10) 0%, rgba(227, 6, 19, 0) 70%);
}

/* Backdrop variant B: soft diagonal panel */
.specialty-card-media--diagonal::before {
    content: "";
    position: absolute;
    z-index: 1;
    inset: -12% -12%;
    background: linear-gradient(135deg, #f2f2f2 0%, #e8e8e8 100%);
    clip-path: polygon(38% 0, 100% 0, 100% 100%, 8% 100%);
}

/* Real photograph variant: the photo itself fills the media area edge to
   edge (protagonist visual), the ::after fade mask (base rule) blends it
   into the white content column. */
.specialty-card-media--photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Small, unobtrusive photo credit required by the CC BY-SA 4.0 license on
   the Telecomunicaciones rack photo (Wikimedia Commons). */
.specialty-card-media__credit {
    position: absolute;
    z-index: 4;
    right: 10px;
    bottom: 8px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(14, 14, 14, 0.55);
    color: #ffffff;
    font-size: 0.62rem;
    line-height: 1.4;
    letter-spacing: 0.01em;
    text-decoration: none;
    pointer-events: auto;
}

    .specialty-card-media__credit:hover {
        background: rgba(14, 14, 14, 0.75);
        color: #ffffff;
    }

/* ----- Responsive ----- */
@media (max-width: 992px) {
    .specialties-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .specialties-section {
        padding: 56px 0;
    }

    .specialties-header {
        margin-bottom: 36px;
    }

    .specialties-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .specialty-card {
        flex-direction: column;
        min-height: 0;
    }

    .specialty-card-content {
        width: 100%;
        padding: 24px 20px;
        order: 2;
    }

    .specialty-card-media {
        position: relative;
        inset: auto;
        width: 100%;
        height: 150px;
        order: 1;
    }

        .specialty-card-media::after {
            background: linear-gradient(to bottom, var(--background) 0%, rgba(255, 255, 255, 0.7) 14%, rgba(255, 255, 255, 0) 46%);
        }

        .specialty-card-media img {
            width: 46%;
        }

        .specialty-card-media--photo img {
            width: 100%;
            height: 100%;
        }

        .specialty-card-media__credit {
            font-size: 0.58rem;
        }

    .specialty-card-media--diagonal::before {
        clip-path: polygon(0 30%, 100% 0, 100% 100%, 0 100%);
    }
}
