/*
|--------------------------------------------------------------------------
| HOME — RECORRIDO VIRTUAL / MEMORIAS
|--------------------------------------------------------------------------
| Componente compartido.
|
| Variantes:
| - .amoladero-recorrido
| - .amoladero-recorrido--memorias
|--------------------------------------------------------------------------
*/


/* ==========================================================================
   SECTION
   ========================================================================== */

/* ==========================================================
   HOME — ALINEACIÓN HORIZONTAL
   RECORRIDO VIRTUAL Y MEMORIAS
   Solo escritorio — móvil y tablet sin cambios
   ========================================================== */

@media screen and (min-width: 1025px) {

    .amoladero-home
    .amoladero-recorrido
    .amoladero-recorrido__content {

        box-sizing: border-box;

        /* Igualar separación izquierda con Fauna y Flora */
        padding-left: clamp(30px, 2.2vw, 90px) !important;

        /* Evitar desbordamiento */
        width: 100%;
        max-width: 680px;

    }

}

.amoladero-recorrido {
    --recorrido-rail-width:
        clamp(34px, 3.2vw, 50px);

    position: relative;

    width: 100%;

    min-height:
        clamp(460px, 42vw, 620px);

    overflow: hidden;

    background:
        var(--amoladero-deep);

    color:
        var(--amoladero-white);

    /*
     * Crea un contexto de apilamiento propio.
     * Evita interferencias de Gutenberg / wp-block-cover.
     */
    isolation: isolate;
}


/* ==========================================================================
   BACKGROUND IMAGE
   ========================================================================== */

.amoladero-recorrido
.wp-block-cover__image-background {
    position: absolute !important;

    z-index: 0 !important;

    inset: 0 !important;

    display: block;

    width: 100% !important;
    height: 100% !important;

    max-width: none !important;

    margin: 0 !important;
    padding: 0 !important;

    object-fit: cover;

    object-position: center;

    pointer-events: none;

    transition:
        transform 700ms ease;
}


/* ==========================================================================
   DESACTIVAR OVERLAY NATIVO DE WORDPRESS
   ========================================================================== */

/*
 * WordPress puede alterar z-index, opacity o background
 * de esta capa dependiendo de cómo se edite el Cover.
 *
 * La dejamos transparente y controlamos el degradado
 * nosotros con ::after.
 */

.amoladero-recorrido
.wp-block-cover__background {
    position: absolute !important;

    z-index: 0 !important;

    inset: 0 !important;

    background: transparent !important;

    opacity: 0 !important;

    pointer-events: none;
}


/* ==========================================================================
   OVERLAY REAL — RECORRIDO
   ========================================================================== */

.amoladero-recorrido::after {
    content: "";

    position: absolute;

    z-index: 1;

    inset: 0;

    /*
     * Fuerte detrás del texto y progresivamente
     * transparente hacia el lado derecho.
     */
    background:
        linear-gradient(
            90deg,
            rgba(4, 103, 72, 0.90) 0%,
            rgba(4, 103, 72, 0.82) 22%,
            rgba(4, 103, 72, 0.68) 40%,
            rgba(4, 103, 72, 0.46) 58%,
            rgba(4, 103, 72, 0.20) 78%,
            rgba(4, 103, 72, 0.06) 100%
        );

    pointer-events: none;
}


/* ==========================================================================
   OVERLAY — VARIANTE MEMORIAS
   ========================================================================== */

.amoladero-recorrido--memorias::after {
    background:
        linear-gradient(
            90deg,
            rgba(0, 148, 91, 0.96) 0%,
            rgba(0, 148, 91, 0.90) 24%,
            rgba(0, 148, 91, 0.76) 43%,
            rgba(0, 148, 91, 0.54) 61%,
            rgba(0, 148, 91, 0.26) 80%,
            rgba(0, 148, 91, 0.07) 100%
        );
}


/* ==========================================================================
   SIDE RAIL
   ========================================================================== */

.amoladero-recorrido::before {
    content: "";

    position: absolute;

    z-index: 20;

    top: 0;

    left:
        var(--recorrido-rail-width);

    width:
        max(100vh, 1600px);

    height:
        var(--recorrido-rail-width);

    /*
     * Reutilizamos el SVG existente.
     */
    -webkit-mask-image:
        url("../../svg/linea-decorativa-hero.svg");

    mask-image:
        url("../../svg/linea-decorativa-hero.svg");

    -webkit-mask-repeat:
        repeat-x;

    mask-repeat:
        repeat-x;

    -webkit-mask-position:
        left center;

    mask-position:
        left center;

    -webkit-mask-size:
        auto 100%;

    mask-size:
        auto 100%;

    /*
     * Blanco / claro como en la referencia.
     */
    background:
        var(--amoladero-light);

    pointer-events: none;

    transform-origin:
        top left;

    transform:
        rotate(90deg);
}


/* ==========================================================================
   COVER INNER
   ========================================================================== */

.amoladero-recorrido
.wp-block-cover__inner-container {
    position: relative;

    z-index: 5;

    width: 100%;

    min-height:
        inherit;

    margin: 0;
}


/* ==========================================================================
   INNER
   ========================================================================== */

.amoladero-recorrido__inner {
    position: relative;

    z-index: 5;

    display: flex;

    align-items: center;

    width:
        min(
            calc(100% - 150px),
            1420px
        );

    min-height:
        inherit;

    margin-inline:
        auto;
}


/* ==========================================================================
   CONTENT
   ========================================================================== */

.amoladero-recorrido__content {
    display: flex;

    flex-direction: column;

    align-items: flex-start;

    justify-content: center;

    width:
        min(46%, 570px);

    margin: 0;

    padding:
        clamp(64px, 7vw, 110px)
        0;
}


/* ==========================================================================
   TITLE
   ========================================================================== */

.amoladero-recorrido__title {
    width: 100%;

    margin:
        0 0
        clamp(18px, 2vw, 26px);

    color:
        var(--amoladero-white);

    font-family:
        var(--amoladero-font-display);

    font-size:
        clamp(3rem, 4.3vw, 5.2rem);

    font-weight: 400;

    line-height: 0.9;

    letter-spacing:
        -0.02em;

    text-transform:
        uppercase;
}


/* ==========================================================================
   DESCRIPTION
   ========================================================================== */

.amoladero-recorrido__description {
    width: 100%;

    max-width:
        500px;

    margin:
        0 0
        clamp(30px, 3vw, 42px);

    color:
        var(--amoladero-white);

    font-family:
        var(--amoladero-font-body);

    font-size:
        clamp(0.95rem, 1vw, 1.08rem);

    font-weight: 400;

    line-height:
        1.45;
}


/* ==========================================================================
   ACTIONS
   ========================================================================== */

.amoladero-recorrido__actions {
    display: flex;

    align-items: center;

    justify-content: flex-start;

    width: 100%;

    margin: 0;
}


/* ==========================================================================
   BUTTON
   ========================================================================== */

.amoladero-recorrido__button {
    margin: 0;
}


.amoladero-recorrido__button
.wp-block-button__link {
    display: inline-flex;

    align-items: center;

    justify-content: center;

    min-width:
        clamp(160px, 14vw, 210px);

    min-height:
        44px;

    padding:
        12px 30px;

    border: 0;

    border-radius:
        var(--amoladero-radius-pill);

    background:
        var(--amoladero-accent);

    color:
        var(--amoladero-white);

    font-family:
        var(--amoladero-font-heavy);

    font-size:
        0.76rem;

    font-weight: 800;

    line-height: 1;

    text-decoration: none;

    text-transform: uppercase;

    transition:
        background 180ms ease,
        color 180ms ease,
        transform 180ms ease;
}


.amoladero-recorrido__button
.wp-block-button__link:hover {
    background:
        var(--amoladero-white);

    color:
        var(--amoladero-deep);

    transform:
        translateY(-2px);
}


/* ==========================================================================
   BUTTON — MEMORIAS
   ========================================================================== */

.amoladero-recorrido--memorias
.amoladero-recorrido__button
.wp-block-button__link {
    background:
        var(--amoladero-light);

    color:
        var(--amoladero-deep);
}


.amoladero-recorrido--memorias
.amoladero-recorrido__button
.wp-block-button__link:hover {
    background:
        var(--amoladero-white);

    color:
        var(--amoladero-primary);
}


/* ==========================================================================
   TABLET
   ========================================================================== */

@media (max-width: 1024px) {

    .amoladero-recorrido__inner {
        width:
            calc(100% - 110px);
    }


    .amoladero-recorrido__content {
        width:
            min(55%, 520px);
    }


    .amoladero-recorrido__title {
        font-size:
            clamp(2.7rem, 6vw, 4.5rem);
    }

}


/* ==========================================================================
   MOBILE
   ========================================================================== */

@media (max-width: 781px) {

    .amoladero-recorrido {
        --recorrido-rail-width:
            34px;

        min-height:
            clamp(440px, 118vw, 620px);
    }


    /* ----------------------------------------------------------------------
       Background
       ---------------------------------------------------------------------- */

    .amoladero-recorrido
    .wp-block-cover__image-background {
        object-position:
            62% center;
    }


    /* ----------------------------------------------------------------------
       Overlay — Recorrido
       ---------------------------------------------------------------------- */

    .amoladero-recorrido::after {
        background:
            linear-gradient(
                90deg,
                rgba(4, 103, 72, 0.92) 0%,
                rgba(4, 103, 72, 0.84) 30%,
                rgba(4, 103, 72, 0.66) 55%,
                rgba(4, 103, 72, 0.38) 76%,
                rgba(4, 103, 72, 0.12) 100%
            );
    }


    /* ----------------------------------------------------------------------
       Overlay — Memorias
       ---------------------------------------------------------------------- */

    .amoladero-recorrido--memorias::after {
        background:
            linear-gradient(
                90deg,
                rgba(0, 148, 91, 0.95) 0%,
                rgba(0, 148, 91, 0.87) 30%,
                rgba(0, 148, 91, 0.68) 55%,
                rgba(0, 148, 91, 0.40) 76%,
                rgba(0, 148, 91, 0.12) 100%
            );
    }


    /* ----------------------------------------------------------------------
       Inner
       ---------------------------------------------------------------------- */

    .amoladero-recorrido__inner {
        width:
            calc(100% - 70px);

        min-height:
            inherit;

        margin-left:
            52px;

        margin-right:
            18px;
    }


    /* ----------------------------------------------------------------------
       Content
       ---------------------------------------------------------------------- */

    .amoladero-recorrido__content {
        width: 100%;

        max-width:
            none;

        padding:
            58px 0;
    }


    .amoladero-recorrido__title {
        max-width:
            100%;

        font-size:
            clamp(2.65rem, 12vw, 4rem);
    }


    .amoladero-recorrido__description {
        max-width:
            90%;
    }

}


/* ==========================================================================
   SMALL MOBILE
   ========================================================================== */

@media (max-width: 480px) {

    .amoladero-recorrido {
        --recorrido-rail-width:
            30px;
    }


    .amoladero-recorrido
    .wp-block-cover__image-background {
        object-position:
            64% center;
    }


    .amoladero-recorrido__inner {
        width:
            calc(100% - 60px);

        margin-left:
            46px;

        margin-right:
            14px;
    }


    .amoladero-recorrido__content {
        padding:
            48px 0;
    }


    .amoladero-recorrido__title {
        font-size:
            clamp(2.4rem, 12vw, 3.5rem);
    }


    .amoladero-recorrido__description {
        max-width:
            100%;
    }

}


/* ==========================================================================
   VERY SMALL MOBILE
   ========================================================================== */

@media (max-width: 380px) {

    .amoladero-recorrido {
        --recorrido-rail-width:
            28px;
    }


    .amoladero-recorrido__inner {
        width:
            calc(100% - 54px);

        margin-left:
            42px;

        margin-right:
            12px;
    }


    .amoladero-recorrido__content {
        padding:
            42px 0;
    }


    .amoladero-recorrido__title {
        font-size:
            clamp(2.25rem, 11.5vw, 3rem);
    }

}


/* ==========================================================================
   REDUCED MOTION
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {

    .amoladero-recorrido
    .wp-block-cover__image-background,

    .amoladero-recorrido__button
    .wp-block-button__link {
        transition:
            none;
    }

}