/* ═══════════════════════════════════════════════
   EDITORIAL PROJECTS SHOWCASE (v4)
   ═══════════════════════════════════════════════ */

.projects-editorial {
    position: relative;
    padding: var(--space-10) 0;
    overflow: hidden;
}

/* Faded Background Text */
.pe-bg-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: clamp(6rem, 14vw, 16rem);
    line-height: 0.8;
    font-family: var(--font-heading);
    font-weight: 900;
    color: var(--text-primary);
    opacity: 0.04;
    white-space: nowrap;
    pointer-events: none;
    z-index: 0;
    user-select: none;
}
@media (max-width: 991px) {
    .pe-bg-text { display: none; }
}

/* Header */
.pe-header {
    position: relative;
    z-index: 2;
    margin-bottom: var(--space-10);
}

.pe-meta {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    display: block;
    margin-bottom: var(--space-3);
    overflow: hidden;
}

.pe-title-wrapper {
    overflow: hidden;
    line-height: 1.1;
}

.pe-title {
    font-size: clamp(2.2rem, 5vw, 4rem);
    font-family: var(--font-heading);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: -0.03em;
    line-height: 1.1;
    word-break: break-word;
}

/* Editorial List */
.pe-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
    position: relative;
    z-index: 2;
}

.pe-item {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
    padding-top: var(--space-6);
    position: relative;
}

.pe-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0%; /* for animation */
    height: 1px;
    background: var(--border);
    transition: width 1s cubic-bezier(0.77, 0, 0.175, 1);
}

.pe-item.is-visible::before {
    width: 100%;
}

@media (min-width: 992px) {
    .pe-item {
        grid-template-columns: 1fr 1fr;
        align-items: center;
        gap: var(--space-10);
        padding-top: var(--space-8);
    }
    .pe-item:nth-child(even) .pe-content {
        order: 2;
    }
    .pe-item:nth-child(even) .pe-visual {
        order: 1;
    }
}

/* Content Area */
.pe-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Mobile specific reordering */
@media (max-width: 991px) {
    .pe-content {
        display: contents; /* Allows children to be grid items of .pe-item */
    }
    .pe-num { order: 1; }
    .pe-cat-year { order: 2; margin-bottom: 0 !important; }
    .pe-item-title { order: 3; margin-bottom: 0 !important; }
    .pe-visual { order: 4; margin: var(--space-4) 0; }
    .pe-desc { order: 5; }
    .pe-tech { order: 6; }
    .pe-list { gap: clamp(56px, 10vw, 80px); }
    .pe-item { gap: 18px; padding-top: 32px; }
}

.pe-num {
    font-family: var(--font-mono);
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: var(--text-muted);
    font-weight: 300;
    line-height: 1;
    margin-bottom: var(--space-4);
    opacity: 0.5;
}

.pe-cat-year {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: var(--space-2);
}

.pe-cat-year span.divider {
    width: 24px;
    height: 1px;
    background: var(--border);
}

.pe-item-title {
    font-size: clamp(2rem, 4vw, 3.5rem);
    font-family: var(--font-heading);
    margin-bottom: var(--space-4);
    line-height: 1.1;
    overflow: hidden;
}

.pe-item-title a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s;
}
.pe-item-title a:hover {
    color: var(--accent);
}

.pe-desc {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: var(--space-5);
    max-width: 600px;
}

.pe-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: var(--space-5);
}

.pe-tech span {
    padding: 6px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Visual Area */
.pe-visual {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    border-radius: var(--radius-md);
    overflow: hidden;
    display: block;
}

@media (min-width: 992px) {
    .pe-visual {
        aspect-ratio: 16/10;
    }
}

.pe-visual-inner {
    position: absolute;
    inset: -10%; /* allowance for parallax */
    width: 120%;
    height: 120%;
}

.pe-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.pe-visual-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0);
    transition: background 0.4s ease;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Hover Effects */
@media (hover: hover) {
    .pe-visual:hover img {
        transform: scale(1.03);
    }
    .pe-visual:hover .pe-visual-overlay {
        background: rgba(0, 0, 0, 0.3);
    }
    
    .pe-explore-btn {
        opacity: 0;
        transform: translateY(20px);
        background: var(--accent);
        color: var(--bg-primary);
        padding: 12px 24px;
        border-radius: 100px;
        font-family: var(--font-body);
        font-weight: 600;
        font-size: 0.9rem;
        transition: opacity 0.4s, transform 0.4s;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .pe-explore-btn i {
        transition: transform 0.3s;
    }
    
    .pe-visual:hover .pe-explore-btn {
        opacity: 1;
        transform: translateY(0);
    }
    
    .pe-visual:hover .pe-explore-btn i {
        transform: translateX(4px) translateY(-4px);
    }
}

/* Status Badge Container overrides */
.pe-status-badge {
    position: absolute;
    top: 24px;
    left: 24px;
    z-index: 2;
}

@media (max-width: 430px) {
    .projects-editorial { padding-block: 72px; }
    .pe-header { margin-bottom: 56px; }
    .pe-title { font-size: clamp(2.35rem, 12vw, 3.25rem); overflow-wrap: anywhere; }
    .pe-item-title { font-size: clamp(1.9rem, 10vw, 2.7rem); overflow-wrap: anywhere; }
    .pe-visual { aspect-ratio: 1 / 1; margin-block: 16px; }
    .pe-status-badge { top: 12px; left: 12px; max-width: calc(100% - 24px); }
    .pe-desc { font-size: 1rem; margin-bottom: 24px; }
}
