/* =========================================
   PORTFOLIO REFACTOR STYLES (EDITORIAL)
   Scope: .wd-portfolio-archive & .wd-project-page-wrap
   ========================================= */

/* --- 1. ARCHIVE WRAPPER --- */
.wd-portfolio-archive {
    padding-top: 64px;
    padding-bottom: 96px;
    max-width: 1280px;
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
}

/* User "Small Name" override for Global Hero */
body.post-type-archive-project .wd-hero--sunny .wd-hero__title,
body.tax-project_industry .wd-hero--sunny .wd-hero__title {
    font-size: 2.5rem !important;
    margin-bottom: 12px !important;
}

/* --- 2. FEATURED CARD (Existing/Compact) --- */
.wd-featured-card {
    display: grid;
    grid-template-columns: 45% 55%;
    gap: 40px;
    background: #fff;
    border-radius: 20px;
    padding: 32px;
    margin-bottom: 80px;
    /* More breathing room */
    align-items: center;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.wd-featured-image-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.wd-featured-main-img {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.wd-thumb-strip {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.wd-thumb-btn {
    width: 100%;
    aspect-ratio: 1/1;
    border-radius: 6px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
    background: #f3f4f6;
    transition: all 0.2s;
}

.wd-thumb-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wd-thumb-btn:hover {
    border-color: #e5e7eb;
    transform: translateY(-1px);
}

.wd-view-all-tile {
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    font-size: 0.7rem;
    font-weight: 700;
    text-align: center;
}

/* Featured Content */
.wd-featured-content-col {
    padding-left: 12px;
    display: flex;
    flex-direction: column;
}

.wd-feat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    color: #DA9E00;
    margin-bottom: 8px;
}

.wd-feat-title {
    font-size: 2.25rem;
    line-height: 1.1;
    font-weight: 800;
    color: #111;
    margin: 0 0 12px 0;
    letter-spacing: -0.02em;
}

.wd-feat-desc {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #4b5563;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 95%;
    margin: 0;
}

.wd-feat-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.wd-tag-pill {
    background: #f3f4f6;
    color: #374151;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 4px;
    text-transform: uppercase;
}

.wd-trust-line {
    font-size: 0.75rem;
    color: #6B7280;
    margin-bottom: 20px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

.wd-trust-line::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: #22C55E;
    border-radius: 50%;
}

/* Featured Interaction */
.wd-interaction-row {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 16px;
}

.wd-vote-group {
    display: flex;
    gap: 8px;
}

.wd-vote-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 99px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #6B7280;
    cursor: pointer;
    transition: all 0.2s;
}

.wd-vote-pill:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    transform: translateY(-1px);
}

.wd-vote-pill.up.active {
    border-color: #22C55E;
    background: #F0FDF4;
    color: #15803D;
}

.wd-vote-pill.down.active {
    border-color: #EF4444;
    background: #FEF2F2;
    color: #B91C1C;
}

.wd-btn-solid {
    background: #111;
    color: #fff;
    padding: 10px 24px;
    border-radius: 99px;
    font-weight: 700;
    text-decoration: none;
    font-size: 0.9rem;
    transition: transform 0.2s, background 0.2s;
}

.wd-btn-solid:hover {
    background: #000;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* --- 3. EDITORIAL GRID (NEW RHYTHM) --- */
.wd-grid-header {
    margin-bottom: 32px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 16px;
}

.wd-grid-header h3 {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #111;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wd-grid-micro {
    font-size: 0.8rem;
    color: #6B7280;
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    font-style: italic;
    font-family: serif;
    /* Editorial touch */
}

.wd-editorial-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-flow: dense;
    /* Crucial for rhythm */
    gap: 24px;
}

/* RHYTHM LOGIC: 
   Pattern: [BIG 2x1] [1] [1] | [1] [1] [BIG 2x1] 
   This means every 1st item spans 2 cols, then next 2 (idx 2,3) span 1. 
   Then idx 4,5 span 1, idx 6 spans 2.
   Repeats every 6 items? Or simplest:
   child(6n+1) -> Span 2
   child(6n+6) -> Span 2
   Wait, if 1 takes 2 cols, row 1 fills: 2+1+1=4. Good.
   Row 2: 1+1+ ? item 6 needs to be last. 
   So item 4 (span 1), item 5 (span 1), item 6 (span 2). = 4. Good.
   Logic: 
   nth-child(6n+1) -> span 2
   nth-child(6n+6) -> span 2
*/
.wd-editorial-card:nth-child(6n+1),
.wd-editorial-card:nth-child(6n+6) {
    grid-column: span 2;
}

/* Mobile Reset */
@media (max-width: 1024px) {
    .wd-editorial-card:nth-child(n) {
        grid-column: auto;
    }

    .wd-editorial-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .wd-editorial-grid {
        grid-template-columns: 1fr;
    }
}

/* --- 4. PROJECT CARD (EDITORIAL STYLE) --- */
.wd-editorial-card {
    display: block;
    text-decoration: none;
    position: relative;
    border-radius: 16px;
    /* Smooth */
    overflow: hidden;
    cursor: pointer;
    background: #000;
    /* For overlay contrast */
}

/* Image Container (Hero) */
.wd-ed-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    /* Consistent */
    overflow: hidden;
}

.wd-editorial-card:nth-child(6n+1) .wd-ed-img-wrap,
.wd-editorial-card:nth-child(6n+6) .wd-ed-img-wrap {
    aspect-ratio: 16/9;
    /* Wider for featured rhythm items */
}

.wd-ed-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.wd-editorial-card:hover .wd-ed-img-wrap img {
    transform: scale(1.04);
}

/* Overlays */
.wd-ed-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0) 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.wd-editorial-card:hover .wd-ed-overlay {
    opacity: 1;
}

.wd-ed-content {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    z-index: 2;
}

/* Typography (Overlaid) */
.wd-ed-cat {
    position: absolute;
    top: -100%;
    left: 0;
    /* Animated into view? or fixed top? Brief said "Title on image bottom-left, Cat pill top-left" */
}

/* Re-position Cat to Top Left of CARD */
.wd-ed-content .wd-ed-cat {
    display: none;
    /* Hide here, move to top level if requested strictly top-left independent of bottom text */
}

/* We need Cat at TOP LEFT of container */
.wd-editorial-card .wd-ed-cat {
    position: absolute;
    top: 16px;
    left: 16px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #111;
    z-index: 5;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.wd-ed-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transform: translateY(10px);
    transition: transform 0.3s ease;
}

.wd-editorial-card:hover .wd-ed-title {
    transform: translateY(0);
}

/* CTA Reveal */
.wd-ed-cta {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    margin-top: 8px;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease 0.05s;
    /* Delay slightly */
    display: flex;
    align-items: center;
    gap: 4px;
}

.wd-editorial-card:hover .wd-ed-cta {
    opacity: 1;
    transform: translateY(0);
}

/* Editor's Pick Marker */
.wd-ed-pick-marker {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 8px;
    height: 8px;
    background: #FDE047;
    /* Yellow dot */
    border-radius: 50%;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
    z-index: 5;
}

/* --- 5. PAGINATION (DESIGN-LED) --- */
.wd-pagination-editorial {
    margin-top: 60px;
    padding-top: 30px;
    border-top: 1px solid #f3f4f6;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
}

.wd-pagination-meta {
    font-size: 0.75rem;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.wd-pagination-editorial .nav-links {
    display: flex;
    gap: 8px;
    align-items: center;
}

.wd-pagination-editorial .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid transparent;
    background: transparent;
    font-size: 0.9rem;
    color: #6B7280;
    text-decoration: none;
    transition: all 0.2s;
}

.wd-pagination-editorial .page-numbers.current,
.wd-pagination-editorial .page-numbers:hover {
    background: #111;
    color: #fff;
    border-color: #111;
}


/* =========================================
   6. SINGLE PROJECT STYLES (INCLUDED)
   ========================================= */
.wd-project-page-wrap {
    background: #f9fafb;
    min-height: 100vh;
}

.wd-project-hero-section {
    background: #FDE047;
    padding-top: 120px;
    padding-bottom: 120px;
    margin-bottom: -60px;
}

.wd-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

.wd-project-card {
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.08);
    padding: 0;
    overflow: hidden;
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
}

.wd-project-media {
    background: #f3f4f6;
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.wd-main-media-frame {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.wd-project-main-img {
    width: 100%;
    height: auto;
    display: block;
}

.wd-gallery-strip {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.wd-gallery-thumb {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border 0.2s;
}

.wd-gallery-thumb:hover {
    border-color: #111;
}

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

.wd-project-info {
    padding: 40px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.wd-meta-top {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    color: #9CA3AF;
    margin-bottom: 12px;
}

.wd-project-title {
    font-size: 2.5rem;
    line-height: 1.1;
    font-weight: 800;
    color: #111;
    margin: 0 0 16px 0;
}

.wd-client-row {
    margin-bottom: 24px;
    font-size: 0.95rem;
    color: #4B5563;
}

.wd-project-summary {
    font-size: 1.05rem;
    line-height: 1.6;
    color: #374151;
    margin-bottom: 32px;
}

.wd-chips-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 40px;
}

.wd-chip-pill {
    background: #f3f4f6;
    padding: 4px 12px;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #4B5563;
}

.wd-btn-block {
    display: block;
    width: 100%;
    text-align: center;
    background: #111;
    color: #fff;
    padding: 14px;
    border-radius: 12px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
}

.wd-btn-block:hover {
    background: #000;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

.wd-case-study-body {
    padding: 80px 0;
    background: #fff;
}

.wd-container-narrow {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px;
    font-size: 1.125rem;
    line-height: 1.8;
    color: #374151;
}

.wd-case-study-body p {
    margin-bottom: 24px;
}

.wd-case-study-body img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 32px 0;
}

.wd-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #111;
    margin-bottom: 32px;
    opacity: 0.6;
    transition: opacity 0.2s;
    text-decoration: none;
}

.wd-back-link:hover {
    opacity: 1;
}

@media (max-width: 900px) {
    .wd-project-card {
        grid-template-columns: 1fr;
    }

    .wd-project-media {
        padding: 20px;
    }

    .wd-project-info {
        padding: 32px 24px;
    }

    .wd-project-title {
        font-size: 2rem;
    }
}