/**
 * COMPONENTS / CARD
 * -----------------------------------------------------------------------------
 * Tarjeta base blanca del tema y sus piezas comunes (icono, media, marco de
 * imagen). Las tarjetas específicas (servicio, producto, proyecto, testimonio)
 * parten de aquí.
 *
 *   <article class="card card--hover"> ... </article>
 */

.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 34px 30px;
    transition: var(--transition);
}

.card--hover:hover {
    transform: var(--lift-lg);
    border-color: var(--border-blue);
    box-shadow: var(--shadow-md);
}

/* Tarjeta cuya imagen llega al borde */
.card--flush {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Tarjeta sobre fondo oscuro */
.card--dark {
    background: var(--navy-card);
    border-color: var(--border-on-dark);
}

/* =============================================================
   ICONO DE TARJETA
============================================================= */

.icon-box {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    background: var(--blue-soft);
    color: var(--blue);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-md);
    flex-shrink: 0;
}

.icon-box svg {
    width: 26px;
    height: 26px;
}

.icon-box--orange {
    background: var(--orange-soft);
    color: var(--orange);
}

.icon-box--circle {
    border-radius: var(--radius-circle);
    background: var(--white);
    border: 1.5px solid var(--border-blue);
}

.icon-box--sm {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    margin-bottom: 0;
}

.icon-box--sm svg {
    width: 20px;
    height: 20px;
}

/* Sobre fondo oscuro */
.is-dark .icon-box {
    background: var(--surface-on-dark);
    border: 1px solid var(--border-on-dark);
    color: var(--blue-light);
}

/* =============================================================
   MEDIA / MARCO DE IMAGEN
   Sustituye a los image-slot del prototipo: si no hay imagen cargada
   muestra un marcador con textura, nunca un hueco vacío.
============================================================= */

.media {
    position: relative;
    overflow: hidden;
    background: var(--bg-soft);
}

.media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.media--contain img {
    object-fit: contain;
    padding: var(--space-sm);
}

.media--ratio-4-3 { aspect-ratio: 4 / 3; }
.media--ratio-16-9 { aspect-ratio: 16 / 9; }
.media--ratio-1-1 { aspect-ratio: 1 / 1; }

.media--rounded {
    border-radius: var(--radius-xl);
}

/* --- Marcador cuando falta la imagen ----------------------------------- */

.media__placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: var(--space-md);
    text-align: center;
    color: var(--text-muted);
    font-size: var(--fs-sm);
    line-height: 1.4;
    background:
        repeating-linear-gradient(
            45deg,
            transparent 0,
            transparent 12px,
            rgba(47, 128, 237, 0.04) 12px,
            rgba(47, 128, 237, 0.04) 24px
        ),
        var(--bg-soft);
}

.media__placeholder svg {
    width: 28px;
    height: 28px;
    color: var(--border-blue);
}

.is-dark .media__placeholder {
    color: var(--on-dark-soft);
    background:
        repeating-linear-gradient(
            45deg,
            transparent 0,
            transparent 12px,
            rgba(255, 255, 255, 0.03) 12px,
            rgba(255, 255, 255, 0.03) 24px
        ),
        var(--navy-card);
}

/* =============================================================
   TEXTOS COMUNES DE TARJETA
============================================================= */

.card__title {
    font-family: var(--font-heading);
    font-weight: var(--fw-semibold);
    font-size: var(--fs-h4);
    color: var(--heading);
    margin-bottom: var(--space-sm);
}

.card__text {
    font-size: var(--fs-md);
    line-height: var(--lh-body);
    margin-bottom: var(--space-md);
}

.card__eyebrow {
    font-size: var(--fs-xs);
    font-weight: var(--fw-semibold);
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: var(--space-xs);
}
