/**
 * PārthaOS Work App UI — native feed, chips, sheets (v5.6)
 */

/* Accent discipline helpers */
.work-chip.active,
.switcher-item.active {
    color: var(--brand-primary) !important;
}
.switcher-item.active::after {
    background-color: var(--brand-primary) !important;
}

/* Compact mobile chrome */
@media (max-width: 767px) {
    :root {
        --app-switcher-height: 0px;
        --total-top-offset: var(--top-header-height);
    }
    .app-switcher-nav {
        display: none !important;
    }
    body {
        padding-top: var(--top-header-height);
    }
}

/* Work page */
.work-page-hero {
    padding: 28px 20px 12px;
    max-width: 800px;
    margin: 0 auto;
}
.work-page-hero .section-label { margin-bottom: 10px; }
.work-page-hero h1 {
    font-size: clamp(2.2rem, 8vw, 3.2rem);
    letter-spacing: -1.2px;
    margin-bottom: 8px;
    color: var(--text-main);
}
.work-page-hero p {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 1.05rem;
    max-width: 36ch;
}

.work-chips {
    position: sticky;
    top: calc(var(--total-top-offset) + 4px);
    z-index: 60;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 12px 20px 10px;
    max-width: 800px;
    margin: 0 auto;
    background: rgba(244, 246, 249, 0.85);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.work-chips::-webkit-scrollbar { display: none; }

.work-deep-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 20px 14px;
    max-width: 800px;
    margin: 0 auto 6px;
    align-items: center;
}
.work-deep-pill {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(255, 82, 0, 0.18);
    color: var(--text-main);
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}
.work-deep-pill:active { transform: scale(0.96); }
.work-deep-cta {
    margin-left: auto;
}

.work-chip {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 10px 18px;
    border: none;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    background: #f0f3f8;
    box-shadow: 4px 4px 8px rgba(166, 180, 200, 0.28), -3px -3px 6px rgba(255, 255, 255, 0.85);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: transform 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}
.work-chip.active {
    color: var(--brand-primary);
    box-shadow: inset 3px 3px 6px rgba(166, 180, 200, 0.45), inset -3px -3px 6px rgba(255, 255, 255, 0.9);
}
.work-chip:active { transform: scale(0.94); }

.work-feed {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    padding: 8px 16px calc(110px + env(safe-area-inset-bottom));
    max-width: 800px;
    margin: 0 auto;
}
@media (min-width: 768px) {
    .work-feed { grid-template-columns: repeat(3, 1fr); gap: 20px; padding-bottom: 80px; }
}

.work-card {
    display: none;
    background: #f7f9fc;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 20px rgba(166, 180, 200, 0.18);
    cursor: pointer;
    position: relative;
    text-decoration: none;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
    transform: translateZ(0);
    transition: transform 0.15s ease;
}
.work-card.is-visible { display: flex; flex-direction: column; }
.work-card[data-type] { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.work-card:active { transform: scale(0.97); }
.work-card.featured-clay {
    box-shadow: 8px 8px 16px rgba(166, 180, 200, 0.35), -6px -6px 12px rgba(255, 255, 255, 0.9);
}

.work-card-media {
    position: relative;
    aspect-ratio: 3 / 4;
    background: #e8ecf3;
    overflow: hidden;
}
.work-card-media.ratio-web { aspect-ratio: 4 / 3; }
.work-card-media.ratio-reel { aspect-ratio: 9 / 16; }
.work-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.work-card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: rgba(255, 255, 255, 0.9);
    color: var(--brand-primary);
    padding: 6px 10px;
    border-radius: 999px;
}
.work-card-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    pointer-events: none;
}
.work-card-play span {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.55);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}
.work-card-body {
    padding: 12px 12px 14px;
}
.work-card-body h3 {
    font-size: 0.95rem;
    margin: 0 0 4px;
    line-height: 1.25;
    color: var(--text-main);
}
.work-card-body p {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.work-card-actions {
    display: flex;
    gap: 8px;
    padding: 0 12px 12px;
    flex-wrap: wrap;
}
.btn-canva-view {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--brand-gradient);
    color: #fff !important;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    text-decoration: none;
    box-shadow: 4px 6px 12px rgba(255, 82, 0, 0.28);
    -webkit-tap-highlight-color: transparent;
}
.btn-canva-view:active { transform: scale(0.94); }

.work-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    color: var(--text-muted);
    font-weight: 600;
}

/* Home Work strip */
.home-work-strip {
    padding: 10px 0 30px;
}
.home-work-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 0 20px 14px;
    max-width: 800px;
    margin: 0 auto;
}
.home-work-header h2 {
    font-size: 1.8rem;
    margin: 0;
    letter-spacing: -0.6px;
}
.home-work-scroll {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding: 4px 20px 10px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.home-work-scroll::-webkit-scrollbar { display: none; }
.home-work-scroll .work-card {
    display: flex;
    flex-direction: column;
    flex: 0 0 58vw;
    max-width: 240px;
    scroll-snap-align: start;
}
@media (min-width: 768px) {
    .home-work-scroll .work-card { flex-basis: 220px; }
}

/* Vault Canva CTA on masonry */
.masonry-item .btn-canva-view {
    position: absolute;
    left: 10px;
    bottom: 10px;
    z-index: 12;
    opacity: 1;
}
@media (min-width: 768px) {
    .masonry-item .btn-canva-view {
        opacity: 0;
        transition: opacity 0.2s;
    }
    .masonry-item:hover .btn-canva-view { opacity: 1; }
}

/* Reel / media sheet (mobile-native) */
.native-sheet-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(10, 15, 25, 0.72);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s;
}
.native-sheet-modal.active {
    opacity: 1;
    visibility: visible;
}
@media (min-width: 768px) {
    .native-sheet-modal { align-items: center; }
}
.native-sheet {
    width: 100%;
    max-width: 420px;
    background: #0b0d12;
    border-radius: 22px 22px 0 0;
    overflow: hidden;
    transform: translateY(40px);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-height: 92vh;
    padding-bottom: env(safe-area-inset-bottom);
}
@media (min-width: 768px) {
    .native-sheet {
        border-radius: 22px;
        transform: translateY(24px) scale(0.96);
    }
}
.native-sheet-modal.active .native-sheet {
    transform: translateY(0) scale(1);
}
.sheet-handle {
    width: 44px;
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.35);
    margin: 10px auto 8px;
}
.sheet-media {
    width: 100%;
    aspect-ratio: 9 / 16;
    max-height: 78vh;
    background: #000;
    position: relative;
}
.sheet-media video,
.sheet-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.sheet-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font-size: 22px;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.sheet-canva-bar {
    padding: 12px 16px 16px;
    display: flex;
    justify-content: center;
}

/* Flat feed card override for clay budget */
.ig-grid-item,
.masonry-item {
    box-shadow: 0 8px 18px rgba(166, 180, 200, 0.2) !important;
}
@media (min-width: 768px) {
    .package-card,
    .btn-primary {
        box-shadow: 8px 8px 18px rgba(255, 82, 0, 0.22), -4px -4px 10px rgba(255, 255, 255, 0.75);
    }
}
