/* =========================================================
   NUESTRA HISTORIA
========================================================= */

.historia {
    --historia-espacio: clamp(72px, 9vw, 132px);
    --historia-gap: clamp(36px, 5vw, 78px);

    background: var(--marfil);
    color: var(--cafe);
}

/* =========================================================
   ENCABEZADO
========================================================= */

.historia__header {
    min-height: min(620px, 72vh);
    padding-top: clamp(90px, 11vw, 150px);
    padding-bottom: clamp(80px, 10vw, 130px);

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.historia__eyebrow,
.historia-bloque__eyebrow {
    font-family: var(--fuente-texto);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--verde-olivo);
}

.historia__eyebrow {
    margin-bottom: 16px;
}

.historia__title {
    font-size: clamp(48px, 7vw, 82px);
    font-weight: 500;
    line-height: 1;
    text-transform: none;
}

.historia__floritura {
    width: clamp(130px, 17vw, 210px);
    height: 34px;
    margin: 25px auto 23px;
}

.historia__intro {
    max-width: 620px;
    font-size: clamp(14px, 1.35vw, 16px);
    line-height: 1.9;
    font-weight: 300;
}

/* =========================================================
   BLOQUES GENERALES
========================================================= */

.historia-bloque {
    position: relative;
    padding-block: var(--historia-espacio);
}

.historia-bloque__numero {
    margin-bottom: 12px;

    font-family: var(--fuente-texto);
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.18em;
    color: var(--beige);
}

.historia-bloque__eyebrow {
    margin-bottom: 17px;
}

.historia-bloque__title {
    max-width: 620px;
    margin-bottom: 30px;

    font-size: clamp(34px, 4.2vw, 58px);
    font-weight: 500;
    line-height: 1.08;
}

.historia-bloque__copy {
    max-width: 560px;
}

.historia-bloque__copy p {
    margin-bottom: 18px;

    font-size: 15px;
    line-height: 1.95;
    font-weight: 300;
}

.historia-bloque__copy p:last-child {
    margin-bottom: 0;
}

/* =========================================================
   01. EL ORIGEN DE NAPO & LOLA
========================================================= */

/*
   La fotografía funciona como fondo de toda la sección.
   El contenido mantiene el margen del .container.
*/

.historia-origen {
    position: relative;

    min-height: 820px;
    padding-block: 0;

    display: flex;
    flex-direction: column;
    align-items: flex-start;
	justify-content: center;
	padding-inline: clamp(20px, 5vw, 80px);
    overflow: hidden;

    background: var(--marfil);
}

.historia-origen__grid {
    position: relative;
    z-index: 2;

    width: min(
        calc(100% - 40px),
        var(--ancho-contenido)
    );

    margin-inline: 0;   /* ← esto anula el margin-inline: auto de .container */

    display: block;
}

.historia-origen__texto {
    align-self: flex-start;
    text-align: left;
    width: 100%;
    max-width: var(--ancho-contenido); 
}


/* =========================================================
   FOTOGRAFÍA — EL ORIGEN
========================================================= */

.historia-origen .historia-origen__imagen {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;

    z-index: 0;

    width: min(85%, 975px);
    max-width: none;

    margin: 0;

    pointer-events: none;

    -webkit-mask-image: linear-gradient(
        to left,
        rgba(0, 0, 0, 1) 50%,
        rgba(0, 0, 0, 0) 100%
    );
    mask-image: linear-gradient(
        to left,
        rgba(0, 0, 0, 1) 50%,
        rgba(0, 0, 0, 0) 100%
    );
}

.historia-origen__imagen img {
    width: 100%;
    height: 100%;

    object-fit: cover;
	object-position: left center;
    filter:
        grayscale(16%)
        sepia(8%)
        contrast(0.96);
}

.historia-origen .historia-origen__imagen figcaption {
    position: absolute;
    right: 20px;
    bottom: 20px;
    z-index: 1;

    max-width: calc(100% - 40px);

    margin-top: 0;
    padding: 6px 14px;

    background: rgba(250, 249, 247, 0.82);

    color: var(--cafe);
	
	font-size: 13px;
}

/* =========================================================
   DEGRADADO — EL ORIGEN
========================================================= */

.historia-origen::after {
    content: "";

    position: absolute;
    inset: 0;

    z-index: 1;

    pointer-events: none;

    background:
        linear-gradient(
            135deg,
			rgba(250, 249, 247, 0.98) 15%,
            rgba(250, 249, 247, 0.94) 38%,
            rgba(250, 249, 247, 0.76) 52%,
            rgba(250, 249, 247, 0.42) 66%,
            rgba(218, 201, 169, 0.16) 82%,
            rgba(218, 201, 169, 0.04) 100%
        );
}



/* =========================================================
   DIVISOR AL FINAL — EL ORIGEN
========================================================= */
.historia-origen .historia-divider {
    position: absolute;
    left: 50%;
    bottom: 0;
    z-index: 2;

    width: min(100%, 860px);
	height: auto;
    margin-top: 0;

    transform: translateX(-50%);
}

/* =========================================================
   MEDIA / PLACEHOLDERS
========================================================= */

.historia-media {
    position: relative;
    overflow: hidden;
}

.historia-media__placeholder {
    min-height: clamp(390px, 49vw, 650px);

    display: flex;
    align-items: center;
    justify-content: center;

    background:
        linear-gradient(
            135deg,
            rgba(152, 159, 117, 0.18),
            rgba(218, 201, 169, 0.28)
        );

    border: 1px solid rgba(81, 56, 44, 0.10);

    color: rgba(81, 56, 44, 0.52);

    font-family: var(--fuente-texto);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    text-align: center;
}

.historia-media figcaption {
    margin-top: 12px;

    font-family: var(--fuente-texto);
    font-size: 10px;
    font-weight: 300;
    letter-spacing: 0.06em;
    color: rgba(81, 56, 44, 0.62);
}

.historia-media--vintage img {
    width: 100%;
    height: 100%;

    object-fit: cover;

    filter:
        grayscale(16%)
        sepia(8%)
        contrast(0.96);
}

/* =========================================================
   DIVISOR ARTESANAL
========================================================= */

.historia-divider {
    height: 70px;
    margin-top: clamp(35px, 5vw, 65px);

    display: flex;
    align-items: center;
    justify-content: center;
}

.historia-divider span {
    display: block;

    width: min(100%, 860px);
    height: 3px;

    background: rgba(81, 56, 44, 0.28);

    -webkit-mask-image: linear-gradient(
        to right,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 1) 50%,
        rgba(0, 0, 0, 0) 100%
    );
    mask-image: linear-gradient(
        to right,
        rgba(0, 0, 0, 0) 0%,
        rgba(0, 0, 0, 1) 50%,
        rgba(0, 0, 0, 0) 100%
    );
}

/* =========================================================
   02. SAN IGNACIO A TU TAZA
========================================================= */

.historia-origen-cafe {
    padding-top: calc(var(--historia-espacio) * 0.92);
}

.historia-origen-cafe__grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.618fr);
    align-items: center;
    gap: clamp(50px, 7vw, 105px);
}

.historia-origen-cafe__imagen {
    min-height: clamp(420px, 52vw, 690px);
}

.historia-origen-cafe__imagen .historia-media__placeholder {
    min-height: inherit;
}

.historia-origen-cafe__texto {
    max-width: 510px;
    justify-self: start;
}

.historia-origen-cafe__variedades {
    margin-top: 34px;
    padding-top: 22px;

    display: flex;
    flex-wrap: wrap;
    gap: 10px 25px;

    border-top: 1px solid rgba(81, 56, 44, 0.12);
}

.historia-origen-cafe__variedades span {
    font-family: var(--fuente-titulos);
    font-size: 13px;
    font-weight: 500;
    font-style: italic;
}

/* =========================================================
   DIVISOR AL FINAL — SAN IGNACIO
========================================================= */

.historia-origen-cafe .historia-divider {
    position: absolute;
    left: 50%;
    bottom: 0;
    z-index: 2;

    width: min(100%, 860px);
	height: auto;
    margin-top: 0;

    transform: translateX(-50%);
}





/* =========================================================
   03. MÁS QUE CAFÉ / MOMENTOS
========================================================= */

.historia-momentos {
    min-height: 820px;
    padding-block: 0;

    display: flex;
    align-items: center;
    
    padding-inline: clamp(20px, 5vw, 80px);

    overflow: hidden;

    color: var(--marfil);
}

.historia-momentos__parallax,
.historia-momentos__imagen,
.historia-momentos__overlay {
    position: absolute;
    inset: 0;
	z-index: 1;
	
	background:
        linear-gradient(
            135deg,
            rgba(250, 249, 247, 0.98) 0%,
            rgba(250, 249, 247, 0.96) 35%,
            rgba(81, 56, 44, 0.26) 62%,
            rgba(81, 56, 44, 0.45) 100%
        );
}

.historia-momentos__parallax {
    overflow: hidden;
}

/* =========================================================
   FOTOGRAFÍA — NUESTRA ESENCIA
========================================================= */

.historia-momentos__imagen {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;

    width: 38%;
    z-index: 0;
	
	-webkit-mask-image: linear-gradient(
        to left,
        rgba(0, 0, 0, 1) 80%,
        rgba(0, 0, 0, 0) 100%
    );
    mask-image: linear-gradient(
        to left,
        rgba(0, 0, 0, 1) 80%,
        rgba(0, 0, 0, 0) 100%
    );
}

.historia-momentos__imagen .historia-media__placeholder {
    min-height: 100%;
    height: 100%;

    border: 0;
    border-radius: 0;

    background:
        linear-gradient(
            135deg,
            rgba(81, 56, 44, 0.88),
            rgba(152, 159, 117, 0.62)
        );

    color: rgba(250, 249, 247, 0.65);
}

/* =========================================================
   TRANSPARENCIA — NUESTRA ESENCIA
========================================================= */

.historia-momentos__overlay {
    z-index: 1;

    background:
        linear-gradient(
            135deg,
            rgba(81, 56, 44, 0.96) 0%,
            rgba(81, 56, 44, 0.86) 45%,
            rgba(81, 56, 44, 0.62) 68%,
            rgba(250, 249, 247, 0.18) 88%,
            rgba(250, 249, 247, 0.48) 100%
        );
}

/* =========================================================
   CONTENIDO — NUESTRA ESENCIA
========================================================= */

.historia-momentos__contenido {
    position: relative;
    z-index: 2;

    width: min(
        calc(100% - 40px),
        var(--ancho-contenido)
    );
    
    margin-inline: 0;

    padding-block: clamp(100px, 13vw, 170px);
}

.historia-momentos__contenido .historia-bloque__numero {
    color: rgba(250, 249, 247, 0.58);
}

.historia-momentos__contenido .historia-bloque__eyebrow {
    color: var(--beige);
}

.historia-momentos__title {
    max-width: 760px;
    margin-bottom: 35px;

    font-family: var(--fuente-momentos);
    font-size: clamp(45px, 6.3vw, 82px);
    font-weight: 400;
    font-style: italic;
    line-height: 1.05;
}

.historia-momentos__copy {
    max-width: 540px;
    margin-bottom: 18px;

    font-size: 15px;
    line-height: 1.95;
    font-weight: 300;
}

.historia-momentos__copy:last-child {
    margin-bottom: 0;
}

.historia-divider--sobre-fondo {
    position: absolute;
    left: 50%;
    bottom: 0;

    z-index: 3;
	
	height: auto;

    transform: translateX(-50%);
}

.historia-divider--sobre-fondo span {
    background: rgba(152, 159, 117, 0.45);
}

/* =========================================================
   04. CIERRE
========================================================= */

.historia-cierre {
    padding-block: clamp(100px, 13vw, 175px);

    text-align: center;
}

.historia-cierre__contenido {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.historia-cierre__title {
    margin-bottom: 32px;

    font-size: clamp(44px, 6vw, 76px);
    font-weight: 500;
}

.historia-cierre__copy {
    max-width: 620px;
}

.historia-cierre__copy p {
    margin-bottom: 18px;

    font-size: 15px;
    line-height: 1.95;
    font-weight: 300;
}

.historia-cierre__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 46px;
    margin-top: 22px;
    padding-inline: 28px;

    border-radius: var(--radio-suave);

    background: var(--verde-olivo);
    color: var(--marfil);

    font-size: 12px;
    font-weight: 400;
    letter-spacing: 0.08em;
    text-transform: uppercase;

    transition:
        background-color var(--transicion),
        transform var(--transicion);
}

.historia-cierre__button:hover {
    background: var(--cafe);
    transform: translateY(-2px);
}

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

@media (max-width: 900px) {

    .historia-origen-cafe__grid {
        grid-template-columns: 1fr;
        gap: 55px;
    }

    .historia-origen__texto,
    .historia-origen-cafe__texto {
        max-width: 680px;
        justify-self: start;
    }

    .historia-origen-cafe__imagen {
        width: min(100%, 680px);
        justify-self: center;
    }

    .historia-origen-cafe__grid .historia-origen-cafe__imagen {
        order: 2;
    }

    .historia-origen-cafe__grid .historia-origen-cafe__texto {
        order: 1;
    }

    .historia-momentos {
        min-height: 760px;
    }
}

/* =========================================================
   MÓVIL
========================================================= */

@media (max-width: 768px) {

    .historia__header {
        min-height: 540px;

        padding-top: 75px;
        padding-bottom: 70px;
    }

    .historia__intro {
        max-width: 480px;
        line-height: 1.8;
    }

    .historia-bloque {
        padding-block: 72px;
    }

    /* =====================================================
       EL ORIGEN — MÓVIL
    ===================================================== */

    .historia-origen {
        min-height: 720px;
        padding-block: 0;
        
        padding-inline: 15px; 

        background: var(--marfil);
    }

    .historia-origen::after {
        background:
            linear-gradient(
                145deg,
                rgba(250, 249, 247, 0.98) 0%,
                rgba(250, 249, 247, 0.96) 30%,
                rgba(250, 249, 247, 0.90) 50%,
                rgba(250, 249, 247, 0.72) 68%,
                rgba(218, 201, 169, 0.40) 84%,
                rgba(218, 201, 169, 0.25) 100%
            );
    }

    .historia-origen .historia-origen__imagen {
		top: 0;
		right: 0;
		left: 0;
		bottom: 0;
	
		width: 100%;
	
		-webkit-mask-image: none;
		mask-image: none;
	}
	
	.historia-origen__imagen figcaption {
		left: 16px;
		bottom: 16px;
	}

    .historia-origen__grid {
        width: 100%;
        max-width: none;
    }

    /* =====================================================
       TIPOGRAFÍA MÓVIL
    ===================================================== */

    .historia-bloque__title {
        margin-bottom: 24px;
    }

    .historia-bloque__copy p,
    .historia-momentos__copy,
    .historia-cierre__copy p {
        font-size: 14px;
        line-height: 1.85;
    }

    /* =====================================================
       02. SAN IGNACIO — MÓVIL
    ===================================================== */

    .historia-origen-cafe__imagen {
        min-height: 430px;
    }

    /* =====================================================
       DIVISORES — MÓVIL
    ===================================================== */

    .historia-divider {
        height: 55px;
        margin-top: 30px;
    }

    /* =====================================================
       03. MOMENTOS — MÓVIL
    ===================================================== */

    .historia-momentos {
        min-height: 720px;
        padding-inline: 15px;
    }

    .historia-momentos__contenido {
        width: 100%;
        max-width: none;

        padding-block: 100px;
    }

    .historia-momentos__title {
        font-size: clamp(40px, 12vw, 58px);
    }

    /* =====================================================
       04. CIERRE — MÓVIL
    ===================================================== */

    .historia-cierre {
        padding-block: 90px;
    }

}