@import url(../css/themes.css);
@import url(../css/layouts/navbar.css);
@import url(../css/layouts/footer.css);
@import url(../css/layouts/accesibilidad-v1.css);

/* ── Layout general ── */
.cf {
    display: flex;
    flex-direction: column;
    background: #fff;
    font-family: var(--primary-font-family);
}

/* ── Hero ── */
.cf-hero {
    background: linear-gradient(180deg, #f4f6f8 0%, #ffffff 55%);
    padding: 2rem 1.5rem 2.5rem;
    position: relative;
    overflow: hidden;
}

.cf-hero::before {
    content: none;
}

.cf-hero__inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: center;
    max-width: var(--web-margin);
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.cf-hero__content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cf-hero__icons {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.25rem;
    padding: 0.5rem 0.65rem;
    width: fit-content;
    background: #fff;
    border-radius: 9999px;
    box-shadow: 0 2px 10px rgba(4, 50, 77, 0.1);
}

.cf-hero__icon-img {
    display: block;
    object-fit: contain;
}

.cf-hero__title {
    margin: 0;
    font-family: var(--secondary-font-family);
    font-size: clamp(2rem, 4.5vw, 3rem);
    line-height: 1.1;
    color: var(--alternate-background);
}

.cf-hero__title-accent {
    display: block;
    color: var(--primary);
}

.cf-hero__text {
    margin: 0;
    max-width: 32rem;
    font-size: clamp(0.9rem, 1.8vw, 1rem);
    line-height: 1.55;
    color: var(--secondary-text);
}

.cf-hero__text strong {
    color: var(--primary);
    font-family: var(--secondary-font-family);
    font-weight: 700;
}

.cf-hero__badge {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    transform: rotate(-4deg);
    margin-top: 0.5rem;
    width: fit-content;
}

.cf-hero__badge-top {
    background: #ffc107;
    color: var(--primary);
    font-family: var(--secondary-font-family);
    font-size: 0.95rem;
    padding: 0.35rem 1rem;
    border-radius: 6px 6px 0 0;
    letter-spacing: 0.02em;
}

.cf-hero__badge-bottom {
    background: var(--alternate-background);
    color: #ffc107;
    font-family: var(--secondary-font-family);
    font-size: 1.05rem;
    padding: 0.35rem 1rem;
    border-radius: 0 0 6px 6px;
    letter-spacing: 0.02em;
}

.cf-hero__media {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    overflow: hidden;
    border-radius: 12px;
    min-height: 280px;
    max-height: 360px;
}

.cf-hero__img {
    width: auto;
    min-width: 115%;
    height: 100%;
    min-height: 280px;
    max-height: 360px;
    object-fit: cover;
    object-position: 88% center;
}

/* Hero: banner principal a ancho completo */
.cf-hero--banner {
    background: #fff;
    padding: 0;
    overflow: visible;
}

.cf-hero--banner::before {
    content: none;
}

.cf-hero__banner-wrap {
    width: 100%;
    max-width: 100%;
    margin: 0;
    position: relative;
    z-index: 1;
    line-height: 0;
}

.cf-hero__banner-img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 0;
    box-shadow: none;
    object-fit: cover;
}

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

/* ── Separador entre Gestión y Servicio ── */
.cf-br {
    display: block;
    height: 2rem;
    margin: 0;
    border: 0;
    background: #fff;
}

/* ── Secciones ── */
.cf-section {
    padding: 2.5rem 1.5rem 3rem;
}

.cf-section--comunidades {
    background: #fff;
}

.cf-section--gestion {
    background: #f0f7f0;
}

.cf-section--servicio {
    background: #f5f0f7;
}

.cf-section__header {
    text-align: center;
    max-width: 42rem;
    margin: 0 auto 2rem;
}

.cf-section__title {
    margin: 0 0 0.5rem;
    font-family: var(--secondary-font-family);
    font-size: clamp(1.35rem, 2.8vw, 1.75rem);
    color: var(--alternate-background);
    line-height: 1.25;
}

.cf-section__subtitle {
    margin: 0;
    font-size: clamp(0.85rem, 1.6vw, 0.95rem);
    color: var(--secondary-text);
    line-height: 1.5;
}

/* ── Comunidad y Soporte ── */
.cf-comunidad-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1.25rem;
    max-width: var(--web-margin);
    margin: 0 auto;
}

.cf-comunidad-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem 1rem 1.25rem;
    box-shadow: 0 2px 12px rgba(4, 50, 77, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-height: 100%;
}

.cf-comunidad-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(4, 50, 77, 0.14);
}

.cf-comunidad-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 78px;
    height: 78px;
    border-radius: 50%;
    background: linear-gradient(180deg, #39a900 0%, #2f8700 100%);
    margin-bottom: 0.75rem;
}

.cf-comunidad-card__icon img {
    width: 46px;
    height: 46px;
    object-fit: contain;
}

.cf-comunidad-card__title {
    margin: 0 0 0.65rem;
    font-family: var(--secondary-font-family);
    font-size: 0.9rem;
    line-height: 1.3;
}

.cf-comunidad-card__title-first {
    color: var(--primary-text);
}

.cf-comunidad-card__title-rest {
    color: var(--primary);
}

.cf-comunidad-card__desc {
    margin: 0 0 1rem;
    flex: 1;
    font-size: 0.78rem;
    color: var(--secondary-text);
    line-height: 1.45;
}

.cf-comunidad-card__arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-top: auto;
    background-color: #ebf6e8;
    border-radius: 20%;
    transition: background-color 0.2s ease;
}

.cf-comunidad-card__arrow::after {
    content: "";
    display: block;
    width: 14px;
    height: 14px;
    background-color: #39a900;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
    transition: background-color 0.2s ease;
}

.cf-comunidad-card:hover .cf-comunidad-card__arrow {
    background-color: #39a900;
}

.cf-comunidad-card:hover .cf-comunidad-card__arrow::after {
    background-color: #fff;
}

/* ── Gestión de la Formación ── */
.cf-gestion-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    max-width: min(1150px, 90%);
    margin: 0 auto;
}

.cf-gestion-card {
    display: grid;
    grid-template-rows: 88px auto;
    gap: 0.65rem;
    justify-items: center;
    align-content: center;
    text-align: center;
    text-decoration: none;
    background: #fff;
    border-radius: 12px;
    padding: 1.75rem 1.15rem;
    min-height: 195px;
    box-shadow: 0 2px 10px rgba(4, 50, 77, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cf-gestion-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(4, 50, 77, 0.12);
}

.cf-gestion-card__logo-wrap {
    width: 200px;
    height: 88px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
}

.cf-gestion-card__logo {
    display: block;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    margin: 0;
}

/* SVG con espacio vacío arriba en el lienzo; sube sin recortar el círculo SENA */
.cf-gestion-card__logo[src*="virtual.svg"] {
    transform: translateY(-6px);
}

.cf-gestion-card__desc {
    margin: 0;
    width: 100%;
    font-size: 0.75rem;
    color: var(--secondary-text);
    line-height: 1.4;
}

/* ── Servicio al Usuario ── */
.cf-servicio-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.75rem 1.35rem;
    max-width: min(1150px, 90%);
    margin: 0 auto;
    align-items: stretch;
}

/* Centrar las 2 últimas cards (mismo ancho que el resto) */
.cf-servicio-card:nth-child(9) {
    grid-column: 2;
}

.cf-servicio-card:nth-child(10) {
    grid-column: 3;
}

.cf-servicio-card {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    text-decoration: none;
    background: #fff;
    border-radius: 12px;
    padding: 1.35rem 2rem 1.35rem 1.1rem;
    min-height: 136px;
    box-shadow: 0 2px 10px rgba(112, 32, 130, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-width: 0;
}

.cf-servicio-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 16px rgba(112, 32, 130, 0.14);
}

.cf-servicio-card__icon {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    width: 66px;
    height: 66px;
    border-radius: 50%;
    background-color: #81207d;
}

.cf-servicio-card__icon img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

.cf-servicio-card__icon--natural img {
    width: 38px;
    height: 38px;
}

.cf-servicio-card__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.cf-servicio-card__title {
    display: block;
    font-family: var(--secondary-font-family);
    font-size: 0.82rem;
    color: var(--alternate-background);
    line-height: 1.3;
    white-space: normal;
}

.cf-servicio-card__desc {
    font-size: 0.72rem;
    color: var(--secondary-text);
    line-height: 1.35;
}

.cf-servicio-card__arrow {
    position: absolute;
    right: 0.75rem;
    bottom: 0.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background-color: #f2e9f2;
    border-radius: 20%;
    transition: background-color 0.2s ease;
}

.cf-servicio-card__arrow::after {
    content: "";
    display: block;
    width: 14px;
    height: 14px;
    background-color: #702082;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.5'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") center / contain no-repeat;
    transition: background-color 0.2s ease;
}

.cf-servicio-card:hover .cf-servicio-card__arrow {
    background-color: #702082;
}

.cf-servicio-card:hover .cf-servicio-card__arrow::after {
    background-color: #fff;
}

/* ── Responsive ── */
@media (max-width: 1100px) {
    .cf-comunidad-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .cf-gestion-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cf-servicio-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cf-servicio-card:nth-child(9),
    .cf-servicio-card:nth-child(10) {
        grid-column: auto;
    }
}

@media (max-width: 900px) {
    .cf-hero__inner {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .cf-hero__content {
        align-items: center;
    }

    .cf-hero__text {
        max-width: none;
    }

    .cf-hero__media {
        justify-content: center;
    }

    .cf-hero__icons {
        justify-content: center;
    }
}

@media (max-width: 600px) {
    .cf-hero:not(.cf-hero--banner) {
        padding: 1.5rem 1rem 2rem;
    }

    .cf-section {
        padding: 2rem 1rem 2.5rem;
    }

    .cf-comunidad-grid {
        grid-template-columns: 1fr;
        max-width: 20rem;
    }

    .cf-gestion-grid {
        grid-template-columns: 1fr;
    }

    .cf-servicio-grid {
        grid-template-columns: 1fr;
    }
}
