/*
 Theme Name:   Astra Child
 Theme URI:    https://wpastra.com/
 Description:  Child theme for the Astra theme
 Author:       Nico y Marcio
 Template:     astra
 Version:      1.0.0
 Text Domain:  astra-child
*/

/* Tus estilos van aquí */

@import "assets/staff.css?v=1.0.8";

.cm-servicios-grid{
    display: grid;
    gap: 0;
}

/* El layout “cm-hero” por item */
.cm-hero {
    --cyan: #00A9D6;
    --duration: 520ms;
    --ease: cubic-bezier(.2,.8,.2,1);

    --bandRatio: 1;
    --bandRatioHover: 0.01;

    --logoW: 260px;
    --logoH: 180px;

    /* lo setea inline por post: --logoPng: url('...') */
    /* --logoPng: url("..."); */

    --logoWhiteW: 9999px;

    width: 100%;
    height: 244px;
    position: relative;
    overflow: hidden;
    background: #fff;
    padding: 22px 0;
}

.cm-hero__band{
    position: absolute;
    inset: 0;
    background: var(--cyan);
    transform-origin: left center;
    transform: scaleX(var(--bandRatio));
    transition: transform var(--duration) var(--ease);
    will-change: transform;
}

.cm-hero__content{
    position: relative;
    z-index: 2;
    height: 100%;
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 0 28px 0 180px;
    gap: 24px;
}

/* Texto oculto al inicio */
.cm-hero__copy{
    line-height: 1.55;
    max-width: 100%;
    font-size: 18px;
    color: #4b4f55;

    opacity: 0;
    transform: translateX(12px);
    pointer-events: none;

    transition: opacity var(--duration) var(--ease), transform var(--duration) var(--ease);
}

.cm-hero__copy p{
    font-size: 22px;
}
.cm-hero__copy strong{
    font-size: 36px;
    line-height: 1;
}


/* Logo “pintado” por máscara */
.cm-logo{
    width: var(--logoW);
    height: var(--logoH);
    position: relative;
    background: var(--cyan);

    -webkit-mask-image: var(--logoPng);
    mask-image: var(--logoPng);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

/* Capa blanca recortada por ancho “real” de cobertura */
.cm-logo::after{
    content: "";
    position: absolute;
    inset: 0;
    background: #fff;

    -webkit-mask-image: var(--logoPng);
    mask-image: var(--logoPng);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;

    clip-path: inset(0 calc(100% - var(--logoWhiteW)) 0 0);
    transition: clip-path var(--duration) var(--ease);
    will-change: clip-path;
}

@media (prefers-reduced-motion: reduce){
    .cm-hero__band,
    .cm-logo::after,
    .cm-hero__copy{
        transition: none;
    }
}

/* Fallback si no hay soporte de mask */
@supports not ((mask-image: url("")) or (-webkit-mask-image: url(""))){
    .cm-logo{
        background: transparent;
        -webkit-mask-image: none; mask-image: none;
        background-image: var(--logoPng);
        background-repeat: no-repeat;
        background-position: center;
        background-size: contain;
    }
    .cm-logo::after{ display:none; }
}

/* =========================
   Mobile / Tablet behavior (ACCORDION)
   - Tap toggles .cm-open
   - Abre hacia abajo (collapse)
   - Si hay uno abierto, el resto se “aplasta” (solo banda)
   ========================= */

@media (max-width: 1024px){

    /* Variables mobile */
    .cm-hero{
        --mBandH: 200px;     /* alto de la banda cuando está cerrado */
        --mSquashH: 34px;    /* alto de la banda cuando está “aplastado” */
        --mPadX: 22px;
        --mCopyPadY: 26px;

        height: auto;
        min-height: 0;
        padding: 0;
        background: #fff;
        cursor: pointer;
    }

    /* IMPORTANTE: en mobile no usamos el scaleX */
    .cm-hero__band{
        transform: none !important;
        transition: none !important;

        position: absolute;
        top: 0;
        left: 0;
        right: 0;

        height: var(--mBandH);
        background: var(--cyan);

        z-index: 1; /* <- importante */
    }

    /* Re-armamos el contenido en columna y dejamos espacio para la banda superior */
    .cm-hero__content{
        position: relative;
        z-index: 2;

        display: block;
        height: auto;

        padding: var(--mBandH) var(--mPadX) 0 var(--mPadX);
        gap: 0;
    }

    /* Logo centrado dentro de la banda superior */
    .cm-logo{
        position: absolute;
        top: 0;
        left: var(--mPadX);
        right: var(--mPadX);
        margin: 0 auto;

        width: min(78vw, 360px);
        height: var(--mBandH);

        /* lo centramos “visual” */
        display: grid;
        place-items: center;
    }

    /* El logo real (mask) debe tener un tamaño, no ocupar toda la banda */
    .cm-logo{
        /* tamaño del “dibujito” dentro del contenedor */
        -webkit-mask-size: min(70vw, 320px) auto;
        mask-size: min(70vw, 320px) auto;
        -webkit-mask-position: center;
        mask-position: center;
    }

    /* Copy = panel colapsable */
    .cm-hero__copy{
        opacity: 0;
        pointer-events: none;

        max-height: 0;
        overflow: hidden;

        transform: translateY(-6px);
        transition:
                max-height var(--duration) var(--ease),
                opacity var(--duration) var(--ease),
                transform var(--duration) var(--ease);

        /* padding aparece solo al abrir */
        padding: 0;
        color: #4b4f55;
    }

    /* Abierto: aparece el panel hacia abajo */
    .cm-hero.cm-open .cm-hero__copy{
        opacity: 1;
        pointer-events: auto;

        max-height: 1000px; /* suficiente para contenido */
        transform: translateY(0);

        padding: var(--mCopyPadY) 0 var(--mCopyPadY) 0;
    }

    /* Tipografía mobile (ajustá si querés) */
    .cm-hero__copy p{ font-size: 20px; }
    .cm-hero__copy strong{ font-size: 32px; line-height: 1; }

    /* Cuando hay uno abierto, el resto se aplasta (solo banda) */
    .cm-hero.cm-squashed{
        --mBandH: var(--mSquashH);
    }

    .cm-hero.cm-squashed .cm-logo{
        opacity: 0;
        pointer-events: none;
    }

    .cm-hero.cm-squashed .cm-hero__copy{
        max-height: 0 !important;
        opacity: 0 !important;
        padding: 0 !important;
        transform: translateY(-6px) !important;
        pointer-events: none !important;
    }

    /* IMPORTANTÍSIMO: anulamos hover/focus-within desktop */
    .cm-hero:not(.cm-open):is(:hover, :focus-within) .cm-hero__copy{
        opacity: 0 !important;
        transform: translateY(-6px) !important;
        pointer-events: none !important;
        max-height: 0 !important;
        padding: 0 !important;
    }

    .cm-hero.cm-squashed{
        overflow: hidden;
    }

    /* MOBILE: logo SOLO BLANCO (evita “ghosting” cyan/blanco) */
    .cm-hero:not(.cm-hero--special) .cm-logo{
        background: #fff !important; /* la base también blanca */
    }

    .cm-hero:not(.cm-hero--special) .cm-logo::after{
        display: none !important;    /* anulamos la capa blanca extra */
    }

    .cm-hero.cm-hero--special .cm-hero__band {
        left: 0!important;
    }
    .cm-hero.cm-hero--special .cm-hero__content {
        padding-left: 0!important;
        padding-right: 0!important;
    }

    .cm-hero.cm-hero--special .cm-logo--img {
        margin: 0!important;
    }


    .cm-hero.cm-hero--special .more-information-icon {
        display: block;
    }

    .cm-hero.cm-hero--special.cm-open .more-information-icon {
        display: none;
    }


        /* =========================
           SPECIAL (mobile): full viewport + bottom panel
           No hereda el accordion normal
           ========================= */

        .cm-hero.cm-hero--special{
            height: 100vh;
            min-height: 100vh;
            padding: 0 !important;
            overflow: hidden;
            background: var(--cyan); /* el “fondo/banda” va debajo del logo */
        }

        /* La banda pasa a ser FULL background */
        .cm-hero.cm-hero--special .cm-hero__band{
            top: 0;
            left: 0 !important;
            right: 0;
            height: 100%;
        }

        /* Reposicionamos el contenido para que NO use padding del accordion */
        .cm-hero.cm-hero--special .cm-hero__content{
            position: relative;
            z-index: 2;
            height: 100%;
            padding: 0 !important;
            display: block;
        }

        /* Logo grande y centrado arriba (como tu captura) */
        .cm-hero.cm-hero--special .cm-logo--img{
            position: absolute;
            top: 90px;               /* ajustá según header */
            left: 0;
            right: 0;
            margin: 0 auto !important;

            width: min(88vw, 520px);
            height: 260px;

            background: transparent !important;
        }

        .cm-hero.cm-hero--special .cm-logo--img img{
            width: 100%;
            height: 100%;
            object-fit: contain;
            object-position: center;
            display: block;
        }

        /* Panel inferior (collapse) */
        .cm-hero.cm-hero--special .cm-hero__copy{
            position: absolute;
            left: 0;
            right: 0;
            bottom: 0;

            background: #fcebba;
            padding: 0 26px;
            margin: 0;

            max-height: 0;
            overflow: hidden;
            opacity: 0;
            transform: translateY(10px);

            transition:
                    max-height var(--duration) var(--ease),
                    opacity var(--duration) var(--ease),
                    transform var(--duration) var(--ease),
                    padding var(--duration) var(--ease);
        }

        /* Abierto: el panel sube y ocupa buena parte del viewport */
        .cm-hero.cm-hero--special.cm-open .cm-hero__copy{
            max-height: 70vh;
            opacity: 1;
            transform: translateY(0);
            padding: 36px 26px 46px 26px;
        }

        /* En special mobile: NO aplicar estilos de squash (por si quedan) */
        .cm-hero.cm-hero--special.cm-squashed{
            --mBandH: 200px;
        }

    .cm-hero.cm-hero--special{
        --logoSafe: 360px; /* ajustá: es el espacio reservado para el logo */
    }

    .cm-hero.cm-hero--special .cm-logo--img{
        z-index: 3; /* arriba del panel */
    }

    .cm-hero.cm-hero--special .cm-hero__copy{
        z-index: 2;             /* debajo del logo */
        top: var(--logoSafe);   /* <- arranca debajo del logo */
        bottom: 0;
        left: 0;
        right: 0;

        /* importante: ahora el panel no “sube”, se expande dentro de su área */
        transform: none;

        max-height: 0;
        opacity: 0;
        padding: 0 26px;
    }

    .cm-hero.cm-hero--special.cm-open .cm-hero__copy{
        max-height: calc(100vh - var(--logoSafe));
        opacity: 1;
        padding: 36px 26px 46px 26px;
    }

    .cm-hero--special h2 {
        font-size: 2rem!important;
        line-height: 1.2!important;
    }

}


/* Desktop solamente: hover/focus-within */
@media (min-width: 1025px){
    .cm-hero:is(:hover, :focus-within){
        --bandRatio: var(--bandRatioHover);
    }

    .cm-hero:is(:hover, :focus-within) .cm-hero__copy{
        opacity: 1;
        transform: translateX(0);
        pointer-events: auto;
    }

    .cm-hero.cm-hero--special .more-information-icon {
        display: none;
    }
}

/* =========================
   Servicios especiales: mostrar imagen REAL (no máscara)
   ========================= */
.cm-hero.cm-hero--special {
    margin-top: 15px;
    min-height: 360px;
    background: #fcebba;
    padding: 0!important;
}

.cm-hero.cm-hero--special .cm-hero__band {
    left: 93px;
}

.cm-hero.cm-hero--special .cm-hero__content{
    grid-template-columns: auto 1fr;
    gap: 40px;
}

.cm-hero.cm-hero--special .cm-hero__content{
    grid-template-columns: auto 1fr;
    gap: 80px;                 /* más aire entre logo y texto */
    padding-left: 93px;       /* empuja todo el contenido a la derecha */
    padding-right: 48px;
}

.cm-hero.cm-hero--special .cm-hero__content{
    align-items: center; /* o flex-start si lo querés más arriba */
}

/* En special: renderizamos la imagen tal cual (logo color) */
.cm-hero.cm-hero--special .cm-logo{
    background: var(--cyan) !important;

    /* apagar modo máscara del layout normal */
    -webkit-mask-image: none !important;
    mask-image: none !important;

    /* usar la imagen real que ya viene en --logoPng (desde PHP) */
    background-image: var(--logoPng) !important;
    background-repeat: no-repeat;
    background-position: left center;
    background-size: contain;

    padding: 20px;
}

/* En special: nunca usar la capa blanca */
.cm-hero.cm-hero--special .cm-logo::after{
    display: none !important;
}

/* Si quedó algún ::before / ::after del fix anterior, lo neutralizamos */
.cm-hero.cm-hero--special .cm-logo::before{
    content: none !important;
}

/* Special: logo como <img> (no máscara / no ::after) */
.cm-hero.cm-hero--special .cm-logo--img{
    position: relative;
    background: var(--cyan) !important;
    -webkit-mask-image: none !important;
    mask-image: none !important;
}

.cm-hero.cm-hero--special .cm-logo--img::after{
    display: none !important;
}

.cm-hero.cm-hero--special .cm-logo--img img{
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    object-position: left center;
}


.cm-hero--special h2 {
    font-family: "Tallica", sans-serif!important;
    color: var(--cyan);
    font-size: 2.5rem;
}

.cm-hero--special p {
    font-family: "Clarendon", sans-serif;
    font-size: 1.5rem;
}

