/*
Theme Name:   UiCore Pro Child
Template:     uicore-pro
Description:  Child theme para UiCore Pro — Cree Estudio
Version:      2.0
*/


/* ==========================================================================
   SINGLE PROYECTO  —  Estilo BTTR adaptado a Cree Estudio
   Prefijo: proy-
   v2.0 — Fecha en hero, descripción ACF en sidebar, nav entre proyectos
   ========================================================================== */

:root {
    --proy-sidebar-w: 320px;
    --proy-header-h:  80px;
    --proy-border:    rgba(128, 128, 128, 0.12);
    --proy-accent:    #9C79B5;
    --proy-gap:       0px;
    --proy-radius:    0px;
}


/* -------------------------------------------------------
   1. HERO — 100vh con overlay degradado
   ------------------------------------------------------- */
.proy-hero {
    position: relative;
    width: 100%;
    height: 100vh;
    height: 100svh;
    overflow: hidden;
}

.proy-hero__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transform: scale(1.04);
    will-change: transform;
    animation: proy-heroZoom 8s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

@keyframes proy-heroZoom {
    to { transform: scale(1); }
}

.proy-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0.02) 0%,
        rgba(0, 0, 0, 0.55) 70%,
        rgba(0, 0, 0, 0.75) 100%
    );
}

.proy-hero__content {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 0 5vw 56px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.proy-hero__title {
    font-size: clamp(2.5rem, 7vw, 7rem);
    font-weight: 800;
    line-height: 0.9;
    text-transform: uppercase;
    letter-spacing: -0.03em;
    color: #fff;
    margin: 0;
    max-width: 65%;
    display: none !important;
}

.proy-hero__meta {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-bottom: 10px;
}

.proy-hero__meta span {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.3s ease;
}

.proy-hero__meta-date {
    color: rgba(255, 255, 255, 0.7) !important;
    font-size: 0.65rem !important;
    font-variant-numeric: tabular-nums;
}


/* -------------------------------------------------------
   2. BODY — Sidebar fijo + Panel de imágenes
   ------------------------------------------------------- */
.proy-body {
    display: flex;
    align-items: flex-start;
}


/* -------------------------------------------------------
   3. SIDEBAR — Sticky, altura completa del viewport
   ------------------------------------------------------- */
.proy-sidebar {
    position: sticky;
    top: var(--proy-header-h);
    width: var(--proy-sidebar-w);
    flex-shrink: 0;
    height: calc(100vh - var(--proy-header-h));
    height: calc(100svh - var(--proy-header-h));
    border-right: 1px solid var(--proy-border);
    display: flex;
    flex-direction: column;
    padding: 48px 32px 32px;
    overflow-y: auto;
}

/* Scrollbar sutil */
.proy-sidebar::-webkit-scrollbar { width: 3px; }
.proy-sidebar::-webkit-scrollbar-track { background: transparent; }
.proy-sidebar::-webkit-scrollbar-thumb { background: rgba(128,128,128,0.2); border-radius: 2px; }
.proy-sidebar { scrollbar-width: thin; scrollbar-color: rgba(128,128,128,0.2) transparent; }

.proy-sidebar__title {
    font-size: 1.3rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.01em;
    line-height: 1.15;
    margin: 0 0 6px;
}

.proy-sidebar__subtitle {
    font-size: 0.78rem;
    font-weight: 400;
    opacity: 0.45;
    line-height: 1.5;
    margin: 0 0 32px;
}

.proy-sidebar__meta {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--proy-border);
    margin-bottom: 28px;
}

.proy-sidebar__label {
    font-size: 0.5rem;
    font-weight: 700;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    opacity: 0.35;
    margin: 0 0 3px;
}

.proy-sidebar__value {
    font-size: 0.78rem;
    font-weight: 600;
    margin: 0;
}

.proy-sidebar__desc {
    font-size: 0.78rem;
    line-height: 1.85;
    opacity: 0.5;
    flex: 1;
}

.proy-sidebar__desc p {
    margin: 0 0 14px;
}

.proy-sidebar__desc p:last-child {
    margin-bottom: 0;
}


/* --- Navegación entre proyectos --- */
.proy-sidebar__nav {
    margin-top: auto;
    padding-top: 28px;
    border-top: 1px solid var(--proy-border);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.proy-sidebar__nav-link {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-decoration: none;
    color: inherit;
    padding: 10px 0;
    transition: opacity 0.25s ease;
}

.proy-sidebar__nav-link:hover {
    opacity: 0.7;
}

.proy-sidebar__nav-label {
    font-size: 0.5rem;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    opacity: 0.35;
}

.proy-sidebar__nav-title {
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.3;
}

.proy-sidebar__nav-link--next {
    text-align: right;
}


/* -------------------------------------------------------
   4. PANEL DE IMÁGENES — Grid Dinámico 1, 2, 1, 2
   ------------------------------------------------------- */
.proy-panel {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--proy-gap);
    align-content: start;
    padding: var(--proy-gap);
}

/* Base para todas las imágenes */
.proy-panel__img {
    width: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: var(--proy-radius);
    overflow: hidden;
}

/* PATRÓN: 1ra de cada trío → ancho completo */
.proy-panel__img:nth-child(3n + 1) {
    grid-column: span 2;
    height: 72vh;
}

/* PATRÓN: 2da y 3ra de cada trío → lado a lado */
.proy-panel__img:nth-child(3n + 2),
.proy-panel__img:nth-child(3n + 3) {
    grid-column: span 1;
    height: 48vh;
}

.proy-panel__empty {
    grid-column: span 2;
    padding: 120px 40px;
    text-align: center;
    opacity: 0.35;
    font-style: italic;
    font-size: 0.85rem;
}


/* -------------------------------------------------------
   5. SCROLL REVEAL — con soporte para stagger
   ------------------------------------------------------- */
.proy-reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.proy-reveal.proy-visible {
    opacity: 1;
    transform: translateY(0);
}


/* -------------------------------------------------------
   6. RESPONSIVE
   ------------------------------------------------------- */

/* Desktop grande — sidebar más ancho */
@media (min-width: 1600px) {
    :root {
        --proy-sidebar-w: 380px;
        --proy-gap: 0px;
    }
}

/* Tablet */
@media (max-width: 1024px) {
    :root {
        --proy-sidebar-w: 280px;
    }

    .proy-hero__title {
        max-width: 70%;
    }

    .proy-panel__img:nth-child(3n + 1) {
        height: 60vh;
    }

    .proy-panel__img:nth-child(3n + 2),
    .proy-panel__img:nth-child(3n + 3) {
        height: 40vh;
    }
}

/* Tablet vertical y menor — layout apilado */
@media (max-width: 900px) {
    .proy-body {
        flex-direction: column;
    }

    .proy-sidebar {
        position: relative;
        top: 0;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--proy-border);
        padding: 32px 5vw;
        flex-direction: column;
    }

    .proy-sidebar__nav {
        flex-direction: row;
        justify-content: space-between;
    }

    .proy-sidebar__nav-link {
        flex: 1;
    }

    .proy-panel {
        padding: 5vw;
        gap: 16px;
    }

    .proy-panel__img:nth-child(3n + 1) {
        height: 56vw;
    }

    .proy-panel__img:nth-child(3n + 2),
    .proy-panel__img:nth-child(3n + 3) {
        height: 44vw;
    }

    .proy-hero__content {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        padding-bottom: 64px;
    }

    .proy-hero__title {
        max-width: 100%;
    }

    .proy-hero__meta {
        text-align: left;
    }
}

/* Móvil */
@media (max-width: 600px) {
    .proy-hero {
        height: 75vh;
        height: 75svh;
    }

    .proy-hero__title {
        font-size: clamp(1.8rem, 10vw, 2.8rem);
    }

    .proy-hero__content {
        padding: 0 6vw 48px;
    }

    .proy-sidebar {
        padding: 28px 6vw;
    }

    .proy-sidebar__title {
        font-size: 1.1rem;
    }

    .proy-sidebar__nav {
        flex-direction: column;
    }

    .proy-sidebar__nav-link--next {
        text-align: left;
    }

    /* En móvil: todas las imágenes full width */
    .proy-panel {
        grid-template-columns: 1fr;
        padding: 4vw;
        gap: 12px;
    }

    .proy-panel__img:nth-child(3n + 1),
    .proy-panel__img:nth-child(3n + 2),
    .proy-panel__img:nth-child(3n + 3) {
        grid-column: span 1;
        height: 65vw;
    }

    .proy-panel__empty {
        grid-column: span 1;
        padding: 80px 20px;
    }
}

/* Móvil pequeño */
@media (max-width: 400px) {
    .proy-hero {
        height: 65vh;
        height: 65svh;
    }

    .proy-hero__title {
        font-size: 1.6rem;
    }

    .proy-panel__img:nth-child(3n + 1),
    .proy-panel__img:nth-child(3n + 2),
    .proy-panel__img:nth-child(3n + 3) {
        height: 58vw;
    }
}

/* ==========================================================================
   ARCHIVE PROYECTOS  —  Masonry + Color Blur Hover
   Prefijo: arch-
   ========================================================================== */

.arch-wrapper {
    padding: 100px 20px 80px;
}

.arch-grid {
    columns: 2;
    column-gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
}


/* --- Card base --- */
.arch-card {
    position: relative;
    display: block;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
    break-inside: avoid;
    margin-bottom: 20px;
}


/* --- Media (imagen) --- */
.arch-card__media {
    width: 100%;
    position: relative;
    overflow: hidden;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Alturas variadas para masonry orgánico */
.arch-card--tall .arch-card__media  { height: 65vh; }
.arch-card--mid  .arch-card__media  { height: 50vh; }
.arch-card--short .arch-card__media { height: 38vh; }


/* --- Imagen zoom en hover --- */
.arch-card__media::before {
    content: '';
    position: absolute;
    inset: 0;
    background: inherit;
    background-size: cover;
    background-position: center;
    transition: transform 0.7s cubic-bezier(0.22, 0.61, 0.36, 1);
    z-index: 0;
}

.arch-card:hover .arch-card__media::before {
    transform: scale(1.06);
}


/* --- Color blur overlay (el efecto signature) --- */
.arch-card__media::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--card-color, rgba(0,0,0,0.3));
    opacity: 0;
    mix-blend-mode: normal;
    backdrop-filter: blur(28px) saturate(1.8);
    -webkit-backdrop-filter: blur(28px) saturate(1.8);
    transition: opacity 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
    z-index: 1;
}

.arch-card:hover .arch-card__media::after {
    opacity: 0.75;
}


/* --- Overlay de texto (sobre el blur) --- */
.arch-card__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 32px;
    z-index: 2;
    pointer-events: none;
}


/* --- Texto --- */
.arch-card__text {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    opacity: 0;
    transform: translateY(16px) scale(0.96);
    transition: opacity 0.45s cubic-bezier(0.22, 0.61, 0.36, 1) 0.05s,
                transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1) 0.05s;
}

.arch-card:hover .arch-card__text {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.arch-card__title {
    font-size: 1.4rem;
    font-weight: 800;
    color: #fff;
    line-height: 1.15;
    text-transform: uppercase;
    letter-spacing: -0.01em;
}

.arch-card__sub {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
}

.arch-card__line {
    width: 24px;
    height: 2px;
    background: var(--proy-accent, #9C79B5);
    margin-top: 4px;
    transform: scaleX(0);
    transition: transform 0.4s cubic-bezier(0.22, 0.61, 0.36, 1) 0.15s;
}

.arch-card:hover .arch-card__line {
    transform: scaleX(1);
}


/* --- Scroll Reveal --- */
.arch-reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.22, 0.61, 0.36, 1),
                transform 0.8s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.arch-reveal.arch-visible {
    opacity: 1;
    transform: translateY(0);
}


/* --- Empty state --- */
.arch-empty {
    column-span: all;
    text-align: center;
    padding: 120px 40px;
    opacity: 0.35;
    font-style: italic;
}


/* -------------------------------------------------------
   ARCHIVE RESPONSIVE
   ------------------------------------------------------- */

@media (min-width: 1600px) {
    .arch-grid {
        columns: 3;
        max-width: 1600px;
    }

    .arch-card__title {
        font-size: 1.6rem;
    }
}

/* Tablet */
@media (max-width: 900px) {
    .arch-wrapper {
        padding: 80px 16px 60px;
    }

    .arch-grid {
        column-gap: 14px;
    }

    .arch-card {
        margin-bottom: 14px;
    }

    .arch-card--tall .arch-card__media  { height: 50vh; }
    .arch-card--mid  .arch-card__media  { height: 40vh; }
    .arch-card--short .arch-card__media { height: 32vh; }

    .arch-card__title {
        font-size: 1.2rem;
    }
}

/* Móvil — columna única */
@media (max-width: 600px) {
    .arch-wrapper {
        padding: 70px 0 48px;
    }

    .arch-grid {
        columns: 1;
        column-gap: 0;
    }

    .arch-card {
        margin-bottom: 4px;
    }

    .arch-card--tall .arch-card__media,
    .arch-card--mid  .arch-card__media,
    .arch-card--short .arch-card__media {
        height: 60vw;
    }

    /* Overlay siempre visible en touch */
    .arch-card__media::after {
        opacity: 0;
    }

    .arch-card__overlay {
        justify-content: flex-end;
        align-items: flex-start;
        text-align: left;
        padding: 20px 16px;
        background: linear-gradient(
            to bottom,
            rgba(0, 0, 0, 0) 0%,
            rgba(0, 0, 0, 0) 45%,
            rgba(0, 0, 0, 0.6) 100%
        );
    }

    .arch-card__text {
        opacity: 1;
        transform: none;
        align-items: flex-start;
        gap: 4px;
    }

    .arch-card__line {
        transform: scaleX(1);
    }

    .arch-card__title {
        font-size: 1rem;
    }

    .arch-card__sub {
        font-size: 0.6rem;
    }
}