/* =============================================================
   Mediabroz — Work / Portfolio page
   ============================================================= */

/* Clear the fixed navbar */
.work-showcase {
    padding-top: 9rem;
}

/* ── Filter tabs ─────────────────────────────────────────────── */
.work-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.625rem;
    margin-bottom: 3rem;
}

.work-filter {
    padding: 0.625rem 1.375rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 100px;
    color: var(--text-muted, #8a90aa);
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.22s, background 0.22s, border-color 0.22s;
}

.work-filter:hover {
    color: #fff;
    border-color: rgba(103, 84, 233, 0.45);
}

.work-filter.active {
    color: #fff;
    background: rgba(103, 84, 233, 0.18);
    border-color: rgba(103, 84, 233, 0.55);
}

.work-filter:focus-visible {
    outline: 2px solid #8b7cf0;
    outline-offset: 2px;
}

/* ── Grid ────────────────────────────────────────────────────── */
.work-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    gap: 1.75rem;
}

.work-item {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
    margin: 0;
}

.work-item[hidden] { display: none; }

/* Media frame */
.work-media {
    position: relative;
    display: block;
    border-radius: 16px;
    overflow: hidden;
    background: #0f1018;
    border: 1px solid rgba(255, 255, 255, 0.07);
    aspect-ratio: 1 / 1;
    transition: border-color 0.25s ease, transform 0.25s ease;
}

/* Reels and UGC are shot vertical */
.work-media-vertical { aspect-ratio: 9 / 16; }

.work-item:hover .work-media {
    border-color: rgba(103, 84, 233, 0.5);
    transform: translateY(-4px);
}

.work-media img,
.work-media video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ── Click-to-play Drive video tiles ─────────────────────────── */
.work-video { cursor: pointer; }

.work-thumb {
    transition: transform 0.35s ease, opacity 0.2s ease;
}

.work-video:hover .work-thumb { transform: scale(1.04); }

/* Fallback background when Drive can't return a thumbnail */
.work-video.no-thumb {
    background:
        radial-gradient(circle at 50% 35%, rgba(103, 84, 233, 0.25) 0%, transparent 60%),
        linear-gradient(160deg, #0d0d18 0%, #111128 60%, #0b0c16 100%);
}

.work-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: none;
    background: rgba(103, 84, 233, 0.92);
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-left: 4px;
    box-shadow: 0 6px 22px rgba(103, 84, 233, 0.5);
    transition: transform 0.2s ease, background 0.2s ease;
    z-index: 2;
}

.work-video:hover .work-play {
    transform: translate(-50%, -50%) scale(1.1);
    background: #6754E9;
}

.work-play:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

.work-video.is-playing { cursor: default; }
.work-video.is-playing .work-play { display: none; }

.work-media iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* ── Fullscreen video lightbox ───────────────────────────────── */
.work-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(4, 4, 8, 0.92);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}

.work-lightbox[hidden] { display: none; }

.work-lb-stage {
    position: relative;
    aspect-ratio: 9 / 16;
    height: 85vh;
    max-width: 92vw;
    background: #000;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.6);
}

.work-lb-stage iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.work-lb-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 1.25rem;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.work-lb-close:hover { background: rgba(255, 255, 255, 0.26); }

.work-lb-close:focus-visible {
    outline: 2px solid #8b7cf0;
    outline-offset: 3px;
}

/* Live-site tiles */
.work-media-site {
    text-decoration: none;
    aspect-ratio: 4 / 3;
    background:
        radial-gradient(circle at 30% 20%, rgba(103, 84, 233, 0.22) 0%, transparent 60%),
        linear-gradient(160deg, #0d0d18 0%, #111128 60%, #0b0c16 100%);
}

.work-site-inner {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.5rem;
    text-align: center;
}

.work-site-inner i {
    font-size: 1.125rem;
    color: #a394ff;
    margin-bottom: 0.25rem;
    transition: transform 0.25s ease;
}

.work-item:hover .work-site-inner i { transform: translate(3px, -3px); }

.work-site-inner strong {
    font-size: 1rem;
    font-weight: 700;
    color: #fff;
    word-break: break-all;
}

.work-site-inner span {
    font-size: 0.8125rem;
    color: #7b83a0;
}

/* Placeholder tiles — visible until real assets land */
.work-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 1.5px dashed rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    color: #5b6282;
}

.work-placeholder i { font-size: 1.75rem; color: rgba(103, 84, 233, 0.55); }

.work-placeholder span {
    font-size: 0.875rem;
    font-weight: 600;
    color: #7b83a0;
}

.work-placeholder small {
    font-size: 0.6875rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    color: #454a63;
}

.work-item-empty { opacity: 0.75; }

/* Captions */
.work-item figcaption {
    display: flex;
    flex-direction: column;
    gap: 0.1875rem;
    padding-left: 0.125rem;
}

.work-item figcaption h3 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-main, #e2e4ef);
}

.work-item figcaption span {
    font-size: 0.8125rem;
    color: #5b6282;
}

.work-empty-msg {
    text-align: center;
    color: #5b6282;
    padding: 3rem 0;
}

@media (max-width: 640px) {
    .work-showcase { padding-top: 7rem; }
    .work-grid { grid-template-columns: repeat(2, 1fr); gap: 0.875rem; }
    .work-filters { gap: 0.5rem; margin-bottom: 2rem; }
    .work-filter { padding: 0.5rem 1rem; font-size: 0.8125rem; }
    /* smaller play badge so it doesn't dominate the little thumbnail */
    .work-play { width: 46px; height: 46px; font-size: 0.95rem; }
    .work-lb-stage { height: auto; width: 92vw; max-height: 82vh; }
    .work-lb-close { top: 12px; right: 12px; }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
    .work-media,
    .work-site-inner i {
        transition: none;
    }
    .work-item:hover .work-media { transform: none; }
}
