/**
 * Proyectos Archive Styles - Propaganda v2
 *
 * Desktop: single item centrado con nav numérica
 * Mobile: scroll vertical libre
 *
 * @package Propaganda_v2
 * @version 3.0.0
 */

/* ============================================
   SCROLL CONTAINER
   ============================================ */

.page-template-page-proyectos .site {
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

.archive-scroll {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

/* ============================================
   ITEMS — desktop: centrado como single-proyecto
   ============================================ */
.archive-item {
    overflow: hidden;
    perspective: 1200px;
}

.archive-item a {
    display: block;
    width: 100%;
    height: 100%;
}

.archive-item a:hover {
    opacity: 1;
}

/* ============================================
   FLIP CARD — hover
   ============================================ */
.archive-flip-card {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.archive-item a:hover .archive-flip-card {
    transform: rotateX(180deg);
}

.archive-flip-front,
.archive-flip-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.archive-flip-front video,
.archive-flip-front img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.archive-flip-back {
    transform: rotateX(180deg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #fdfdfd;
    color: #000;
    -webkit-font-smoothing: antialiased;
    text-align: center;
    padding: 1rem;
    transition: background-color 0.5s cubic-bezier(0.4, 0, 0.2, 1), color 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.archive-flip-cat {
    font-family: 'TWK Lausanne';
    font-size: 14px;
}

.archive-flip-title {
    font-family: 'TWK Lausanne';
    font-size: 24px;
    font-weight: 400;
    margin: 0;
    line-height: 1;
}

/* ============================================
   DESKTOP — single item centrado (768px+)
   ============================================ */
@media (min-width: 768px) {
    .archive-item {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        display: flex;
        align-items: center;
        justify-content: center;
        aspect-ratio: auto;
    }

    .archive-item a {
        width: 60%;
        height: auto;
    }

    .archive-flip-card {
        height: auto;
    }

    .archive-flip-front {
        position: relative;
    }

    .archive-flip-front video,
    .archive-flip-front img {
        width: 100%;
        height: auto;
        max-height: calc(80vh - 20px);
        object-fit: contain;
    }
}

/* ============================================
   FOOTER NAV — números (desktop only)
   ============================================ */
.archive-footer {
    display: none;
}

@media (min-width: 768px) {
    .archive-footer {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        justify-content: flex-start;
        align-items: flex-end;
        padding: 10px 16px;
        z-index: 9999;
        pointer-events: none;
    }

    .archive-footer > * {
        pointer-events: auto;
    }

    .archive-nav {
        display: flex;
        gap: 4px;
        font-family: 'TWK Lausanne 350', sans-serif;
        font-size: 38px;
        line-height: 1;
    }

    .archive-nav button {
        background: none;
        border: none;
        cursor: pointer;
        font-family: inherit;
        font-size: inherit;
        color: #000;
        padding: 0;
        transition: opacity 0.3s ease, color 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        opacity: 0.4;
    }

    .archive-nav button:hover {
        opacity: 1;
    }

    .archive-nav button.active {
        opacity: 1;
    }
}

/* ============================================
   MOBILE — scroll vertical libre
   ============================================ */
@media (max-width: 767px) {
    .page-template-page-proyectos .site {
        height: auto;
        overflow: visible;
    }

    .archive-scroll {
        display: flex;
        flex-direction: column;
        height: auto;
        overflow: visible;
        gap: 8px;
        padding: 40px 8px 8px;
    }

    .archive-item {
        width: 100%;
        aspect-ratio: 16 / 9;
    }

    .archive-flip-title {
        font-size: 16px;
    }

    /* Flip por tap en movil */
    .archive-flip-card.flipped {
        transform: rotateX(180deg);
    }
}

/* ============================================
   NIGHT MODE
   ============================================ */
body.night-mode .archive-flip-back {
    background: #000;
    color: #fdfdfd;
}

body.night-mode .archive-nav button {
    color: #fdfdfd;
}
