﻿/* =====================================================
   HABITARQ - ESTILOS ESPECÍFICOS PARA DETALLES DE PROYECTO
===================================================== */

/* INVERSIÓN DE COLOR DEL HEADER PARA FONDO CLARO (Heredado de tu lógica) */
body.project-page .header {
    background: rgba(244, 244, 242, 0.98) !important;
    color: #0a0a0a !important;
    border-bottom: 1px solid var(--line);
}
body.project-page .header .nav-link { color: #0a0a0a !important; }
body.project-page .header .nav-link::after { background: #0a0a0a !important; }
body.project-page .menu-toggle span { background: #0a0a0a !important; }

/* =====================================================
   HERO DEL PROYECTO
===================================================== */
.project-detail-hero {
    padding: 120px 230px 60px; /* Cambiado a 230px */
}

.project-hero-image {
    width: 100%;
    height: 75vh;
    min-height: 500px;
    overflow: hidden;
    background: #d7d7d4;
    position: relative;
}

.project-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 1s ease, transform 1.5s var(--ease);
}

.project-detail-hero:hover .project-hero-image img {
    filter: none;
    transform: scale(1.02);
}

.project-hero-header {
    margin-top: 40px;
    text-align: center;
}

.project-hero-header h1 {
    font-family: var(--font-display);
    font-size: clamp(40px, 6vw, 90px);
    font-weight: 300;
    letter-spacing: -2px;
    text-transform: uppercase;
    line-height: 1;
}

.project-category {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--soft);
    margin-top: 15px;
}

/* =====================================================
   INFORMACIÓN Y CONCEPTO
===================================================== */
.project-info-section {
    padding: 10px 230px 10px; /* Reducido de 250px a 230px */
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 80px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 80px;
}

.project-meta-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px 20px;
    align-content: start;
}

.meta-item span {
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--soft);
    display: block;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 5px;
}

.meta-item p {
    font-size: 13px;
    color: var(--text);
    margin-top: 10px;
}

.project-concept h2 {
    font-family: var(--font-display);
    font-size: clamp(28px, 4vw, 45px);
    font-weight: 300;
    letter-spacing: -1px;
    line-height: 1.1;
    margin-bottom: 30px;
}

.project-concept p {
    font-size: 14px;
    line-height: 1.9;
    color: var(--soft);
    margin-bottom: 20px;
    max-width: 800px;
}

/* =====================================================
   GALERÍA EDITORIAL
===================================================== */
.project-gallery {
    padding: 0 230px 120px; /* Aumentado de 150px a 230px */
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.gallery-row {
    width: 100%;
    overflow: hidden;
    background: #d7d7d4;
}

.gallery-row img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s cubic-bezier(.16, 1, .3, 1);
    filter: none;
    opacity: 1;
}

.gallery-row:hover img {
    transform: scale(1.03);
    filter: none;
    opacity: 1;
}

/* Fila de 2 imágenes */
.gallery-row.half {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    background: transparent;
}

.gallery-row.half img {
    aspect-ratio: 4/5; /* Formato retrato elegante */
}

/* Fila de 1 imagen */
.gallery-row.full img {
    aspect-ratio: 16/9; /* Formato panorámico ancho */
}

/* =====================================================
   SIGUIENTE PROYECTO
===================================================== */
.next-project {
    padding: 0 230px 120px; /* Cambiado a 230px */
    text-align: center;
}

.next-project span {
    display: block;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--soft);
    margin-bottom: 20px;
}

.next-project a {
    font-family: var(--font-display);
    font-size: clamp(40px, 6vw, 80px);
    font-weight: 300;
    letter-spacing: -2px;
    color: var(--text);
    transition: opacity 0.3s ease, transform 0.4s var(--ease);
    display: inline-block;
}

.next-project a:hover {
    opacity: 0.5;
    transform: translateX(10px);
}

/* =====================================================
   ESCALADO PROPORCIONAL DE TEXTOS (PC Y MONITORES GRANDES)
===================================================== */
@media (min-width: 901px) {
    /* Párrafos y descripciones */
    .project-concept p { font-size: clamp(14px, 1.2vw, 19px); }
    .meta-item p { font-size: clamp(13px, 1.4vw, 22px); }
    
    /* Etiquetas y datos técnicos */
    .project-category, .next-project span { font-size: clamp(10px, 1.2vw, 18px); }
    .meta-item span { font-size: clamp(9px, 1.1vw, 16px); }
}
/* =====================================================
   RESPONSIVE (MÓVIL Y TABLET)
===================================================== */
@media (max-width: 900px) {
    .project-detail-hero { padding: 100px 25px 40px; }
    .project-hero-image { height: 50vh; min-height: 350px; }
    
    .project-info-section { 
        grid-template-columns: 1fr; 
        padding: 40px 25px 80px; 
        gap: 50px;
    }
    
    .project-gallery { padding: 0 25px 80px; gap: 25px; }
    .gallery-row.half { gap: 25px; }
    
    .next-project { padding: 40px 25px 100px; }
}

@media (max-width : 839px ){
    .project-detail-hero { padding: 100px 20px 30px; }
    .project-hero-image { height: 40vh; min-height: 250px; }
    
    .project-meta-grid { grid-template-columns: 1fr; gap: 25px; }
    .project-info-section { padding: 30px 20px 60px; gap: 40px; }
    
    .project-gallery { padding: 0 20px 60px; gap: 15px; }
    .gallery-row.half { grid-template-columns: 1fr; gap: 15px; }
    .gallery-row.half img { aspect-ratio: 4/3; }
    
    .next-project { padding: 20px 20px 80px; }
}
/* =====================================================
   LIGHTBOX GALLERY (Visor de imágenes)
===================================================== */
.project-gallery img {
    cursor: pointer; /* Cambia el cursor a una manito para indicar que es clickeable */
    transition: transform 0.8s cubic-bezier(.16, 1, .3, 1);
    filter: none;
    opacity: 1;
}

.project-gallery img:hover {
    transform: scale(1.03);
    filter: none;
    opacity: 1;
}

.lightbox {
    display: none;
    position: fixed;
    z-index: 99999;
    padding-top: 50px;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95); /* Fondo muy oscuro para resaltar la foto */
    justify-content: center;
    align-items: center;
}

.lightbox.active {
    display: flex;
}

.lightbox-img {
    max-width: 90%;
    max-height: 85vh;
    object-fit: contain;
    animation: fadeIn 0.4s ease;
}

.lightbox-close {
    position: absolute;
    top: 25px;
    right: 40px;
    color: #fff;
    font-size: 45px;
    font-weight: 300;
    cursor: pointer;
    transition: color 0.3s;
}

.lightbox-close:hover {
    color: #a0a0a0;
}

.lightbox-prev, .lightbox-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: auto;
    padding: 20px;
    color: white;
    font-weight: 300;
    font-size: 30px;
    background: transparent;
    border: none;
    transition: 0.3s ease;
    user-select: none;
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-prev:hover, .lightbox-next:hover {
    color: #a0a0a0;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.98); }
    to { opacity: 1; transform: scale(1); }
}







/* =====================================================
   AJUSTES PARA EVITAR RECORTES EN FOTOS VERTICALES/HORIZONTALES
===================================================== */
.project-gallery img, .foto-proyecto {
    object-fit: contain !important; /* Evita que la imagen se recorte */
    height: auto !important; 
    aspect-ratio: auto !important; /* Anula el 4/5 o 16/9 forzado */
}

/* Estilo para las fotos Horizontales detectadas */
.foto-horizontal {
    width: 100%;
    max-height: 85vh; 
}

/* Estilo para las fotos Verticales detectadas */
.foto-vertical {
    width: 100%;
    max-width: 550px !important; /* Evita que la foto vertical se estire a los lados */
    margin: 0 auto; 
    display: block;
}

/* Estilo para fotos Cuadradas */
.foto-cuadrada {
    width: 100%;
    max-width: 750px;
    margin: 0 auto;
    display: block;
}



/* =====================================================
   LAYOUT DIVIDIDO (IMAGEN IZQUIERDA / INFO DERECHA)
===================================================== */

/* Convertimos el contenedor principal (main) en un Grid de 2 columnas */
body.hero-split-mode main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    padding: 120px 230px 60px; /* Respetamos tus márgenes globales */
    align-items: start;
}

/* Quitamos los márgenes internos predeterminados porque ahora el 'main' los controla */
body.hero-split-mode .project-detail-hero,
body.hero-split-mode .project-info-section {
    padding: 0;
    border: none;
    margin: 0;
}

/* Ajustes de la imagen vertical en la izquierda */
body.hero-split-mode .project-hero-image {
    height: auto;
    min-height: auto;
    background: transparent;
}

body.hero-split-mode .project-hero-image img {
    object-fit: contain !important; /* Asegura que la foto vertical nunca se corte */
    height: auto;
}

/* Ajustes de la información en la derecha */
body.hero-split-mode .project-info-section {
    display: flex;
    flex-direction: column;
    gap: 40px; /* Espacio entre el título, los datos técnicos y el concepto */
}

/* El título que movimos ahora se alinea a la izquierda */
body.hero-split-mode .project-hero-header {
    margin-top: 0;
    text-align: left;
}

/* Ocultamos el 'Siguiente Proyecto' de las 2 columnas y lo forzamos abajo al centro */
body.hero-split-mode .next-project {
    grid-column: 1 / -1;
    padding: 80px 0 0 0;
}

/* =====================================================
   RESPONSIVE PARA LAYOUT DIVIDIDO (MÓVIL Y TABLET)
===================================================== */
@media (max-width: 900px) {
    /* En pantallas pequeñas, volvemos a apilar la imagen arriba y la info abajo */
    body.hero-split-mode main {
        grid-template-columns: 1fr;
        padding: 100px 25px 40px;
    }
}
/* =====================================================
   HERO IMAGEN HORIZONTAL (100VH TIPO INDEX)
===================================================== */
body.hero-horizontal-mode .project-detail-hero {
    position: relative;
    width: 100%;
    height: 100vh;
    min-height: 600px;
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
}

body.hero-horizontal-mode .project-hero-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 100%;
    z-index: 1;
    background: #0a0a0a;
}

body.hero-horizontal-mode .project-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover !important;
}

body.hero-horizontal-mode .project-hero-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.15) 35%, rgba(0, 0, 0, 0.25) 60%, rgba(0, 0, 0, 0.88) 100%);
    z-index: 2;
    pointer-events: none;
}

body.hero-horizontal-mode .project-hero-header {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: 1100px;
    padding: 0 30px 60px;
    margin: 0 auto;
    text-align: center;
    color: #ffffff;
}

body.hero-horizontal-mode .project-hero-header h1 {
    font-family: var(--font-display);
    font-size: clamp(38px, 6vw, 85px);
    font-weight: 700;
    letter-spacing: -2px;
    text-transform: uppercase;
    line-height: 1.05;
    text-shadow: 0 4px 25px rgba(0, 0, 0, 0.6);
    color: #ffffff;
}

body.hero-horizontal-mode .project-category {
    color: rgba(255, 255, 255, 0.85);
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.6);
    font-weight: 400;
    margin-top: 15px;
    font-size: clamp(10px, 1.1vw, 15px);
    letter-spacing: 2px;
}

body.hero-horizontal-mode .header:not(.scrolled) {
    background: transparent !important;
    border-bottom: none !important;
    color: #ffffff !important;
}

body.hero-horizontal-mode .header:not(.scrolled) .nav-link {
    color: #ffffff !important;
}

body.hero-horizontal-mode .header:not(.scrolled) .nav-link::after {
    background: #ffffff !important;
}

body.hero-horizontal-mode .header:not(.scrolled) .logo-img {
    filter: brightness(0) invert(1) !important;
}

body.hero-horizontal-mode .header:not(.scrolled) .menu-toggle span {
    background: #ffffff !important;
}
/* =====================================================
   HEADER RESPONSIVE MÓVIL (PROYECTOS DETALLE)
===================================================== */
@media (max-width: 900px) {
    .header {
        height: 75px !important;
        padding: 0 20px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
    }
    .nav-left,
    .nav-right,
    .header .nav-left,
    .header .nav-right {
        display: none !important;
    }
    .menu-toggle,
    .header .menu-toggle {
        display: flex !important;
        margin-left: auto !important;
        z-index: 10 !important;
    }
    .logo,
    .header .logo {
        position: absolute !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        z-index: 2 !important;
    }
    .logo-img,
    .header .logo-img {
        height: 30px !important;
        max-width: 180px !important;
        width: auto !important;
        object-fit: contain !important;
    }
}
