/*
Theme Name: casa1942
Description: Tema minimalista para casa1942 con scroll suave y animaciones.
Version: 1.0.0
Author: casa1942
*/

/* Paleta única theme.json: cream / dark / accent / blue */
:root {
    --color-cream: var(--wp--preset--color--cream);
    --color-dark: var(--wp--preset--color--dark);
    --color-accent: var(--wp--preset--color--accent);
    --color-blue: var(--wp--preset--color--blue);
    /* Texto principal: azul de marca (#1f334e), no el gris casi negro (--dark) */
    --color-black: var(--color-blue);
    --color-primary: var(--wp--preset--color--accent);
    --color-white: var(--wp--preset--color--cream);
    --transition-smooth: all 0.3s ease;
    --border-radius: 8px;
    --font-roboto: var(--wp--preset--font-family--roboto);
    /* Cabecera fija (.site-header-sticky): padding vertical + alto máximo del logo */
    --casa1942-header-padding-y: 1.35rem;
    --casa1942-header-logo-max-height: clamp(52px, 9.5vh, 96px);
}

/* Quitar margen vertical que WordPress aplica a hijos de .is-layout-flow */
:root :where(.is-layout-flow) > * {
    margin-block-start: 0;
    margin-block-end: 0;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: clamp(5.5rem, 15vh, 8.5rem);
    font-size: 16px;
}

body {
    font-family: var(--font-roboto, "Roboto", sans-serif);
    color: var(--color-black);
    background-color: var(--color-white);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Utility Classes */
.container {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    min-height: 100vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.section-logo {
    position: relative;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    background-color: var(--color-white);
}

/* Cabecera fija encima del viewport (no empuja el contenido: el primer proyecto arranca en y=0) */
.site-header-sticky.section-logo {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: none;
    z-index: 50;
    min-height: 0;
    overflow: visible;
    border-bottom: none;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.65) 0%,
        rgba(0, 0, 0, 0.35) 42%,
        rgba(0, 0, 0, 0.1) 72%,
        transparent 100%
    );
}

.section-logo-content {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem 3rem;
    text-align: center;
}

.section-logo .logo-xl,
.section-logo .logo-subtitle {
    color: var(--color-dark);
}

.section-about {
    position: relative;
    z-index: 0;
    background-color: var(--color-accent);
    color: var(--color-dark);
    padding: 4rem 0;
    min-height: 100vh;
}

.section-contact {
    position: relative;
    z-index: 60;
    isolation: isolate;
    background-color: var(--color-white);
    min-height: 100vh;
}

.section-project {
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    transition: var(--transition-smooth);
}

.logo-subtitle {
    font-size: 1.2rem;
    font-weight: 300;
    text-align: center;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* About Section */
.about-content {
    max-width: 1200px;
    margin: 0 auto;
    font-size: 1.6rem;
    line-height: 1.5;
    color: var(--color-blue);
}

.about-content p {
    margin-bottom: 1.2rem;
}

.contact-content {
    max-width: 800px;
    margin: 0 auto;
    font-size: 1.2rem;
    line-height: 1.8;
    color: var(--color-black);
}

.contact-content h1 {
    color: var(--color-accent);
    font-size: 6rem;
    font-weight: 700;
}

.contact-content p {
    margin-bottom: 1.5rem;
}

/* Project Blocks: sección full-viewport con slider interno */
.project-block {
    margin: 0;
    position: relative;
    overflow: hidden;
    transition: height 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    content-visibility: auto;
    contain-intrinsic-size: 100vh;
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* overlay opcional: linear-gradient(45deg, rgba(24,39,56,0.75), rgba(255,153,153,0.35)); */
    display: flex;
    align-items: end;
    justify-content: start;
    transition: var(--transition-smooth);
}

.project-expand-btn {
    width: auto;
    height: auto;
    padding: 0 2rem;
    background: transparent;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-smooth);
    z-index: 999;
}

.project-expand-btn::before {
    content: '+';
    font-size: 5rem;
    color: var(--color-primary);
    font-weight: 300;
    transition: var(--transition-smooth);
}

.project-block.expanded .project-expand-btn::before {
    content: '×';
    font-size: 2.5rem;
}

/* Project Content */
.project-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.92));
    padding: 2rem;
    transform: translateY(100%);
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

.project-block.expanded .project-content {
    transform: translateY(0);
}

.project-title {
    font-size: 2.5rem;
    font-weight: 300;
    margin-bottom: 1rem;
    color: var(--color-white);
    text-shadow: 1px 1px 2px rgba(24, 39, 56, 0.45);
}

.project-description {
    font-size: 1.5rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    color: var(--color-white);
    text-shadow: 1px 1px 2px rgba(24, 39, 56, 0.45);
}

/* Gallery Slider */
.project-gallery {
    position: relative;
    height: 300px;
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 2rem;
}

.gallery-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.gallery-slide.active {
    opacity: 1;
}

.gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Responsive Design */
@media (max-width: 768px) {
    .project-content {
        height: 80vh;
        padding: 1.5rem;
    }

    .project-title {
        color: var(--color-white);
        font-size: 2rem;
        text-shadow: none;
    }

    .project-description {
        text-shadow: none;
    }

    .project-expand-btn {
        width: 50px;
        height: 50px;
    }

    .project-expand-btn::before {
        font-size: 1.5rem;
    }
}

img {
    loading: lazy;
}

/* Bootstrap 5: tema vía variables del componente (sin pelear con --bs-btn-*) */
.btn-primary {
    --bs-btn-color: var(--color-dark);
    --bs-btn-bg: transparent;
    --bs-btn-border-color: var(--color-primary);
    --bs-btn-hover-color: var(--color-white);
    --bs-btn-hover-bg: color-mix(in srgb, var(--color-primary) 88%, #000);
    --bs-btn-hover-border-color: color-mix(in srgb, var(--color-primary) 88%, #000);
    --bs-btn-focus-shadow-rgb: 255, 153, 153;
    --bs-btn-active-color: var(--color-white);
    --bs-btn-active-bg: color-mix(in srgb, var(--color-primary) 78%, #000);
    --bs-btn-active-border-color: color-mix(in srgb, var(--color-primary) 78%, #000);
    --bs-btn-disabled-color: var(--color-white);
    --bs-btn-disabled-bg: var(--color-primary);
    --bs-btn-disabled-border-color: var(--color-primary);
    border-radius: 0;
    font-size: 1.5rem;
}

.btn-outline-primary {
    --bs-btn-color: var(--color-primary);
    --bs-btn-border-color: var(--color-primary);
    --bs-btn-hover-color: var(--color-white);
    --bs-btn-hover-bg: var(--color-primary);
    --bs-btn-hover-border-color: var(--color-primary);
    --bs-btn-focus-shadow-rgb: 255, 153, 153;
    --bs-btn-active-color: var(--color-white);
    --bs-btn-active-bg: var(--color-primary);
    --bs-btn-active-border-color: var(--color-primary);
    --bs-btn-disabled-color: var(--color-primary);
    --bs-btn-disabled-bg: transparent;
    --bs-btn-disabled-border-color: var(--color-primary);
}