/* KTG Project Visual Identity — project-specific imagery without turning workspaces into marketing pages. */
.ktg-project-card-with-cover {
    overflow: hidden;
}

.ktg-project-cover-card {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    background:
        radial-gradient(circle at 78% 22%, rgba(235, 169, 59, .28), transparent 30%),
        linear-gradient(135deg, #17365f 0%, #244f7c 56%, #0f223d 100%);
}

.ktg-project-cover-card-featured {
    height: 168px;
}

.ktg-project-cover-card-compact {
    height: 112px;
    margin: -1rem -1rem 1rem;
    border-bottom: 1px solid rgba(148, 163, 184, .18);
}

.ktg-project-cover-image,
.ktg-project-cover-fallback {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.ktg-project-cover-image {
    z-index: 1;
    object-fit: cover;
    opacity: 0;
    transform: scale(1.01);
    transition: opacity .25s ease, transform .4s ease;
}

.ktg-project-cover-card.has-cover-image .ktg-project-cover-image {
    opacity: 1;
}

.ktg-project-cover-card.has-cover-image:hover .ktg-project-cover-image {
    transform: scale(1.025);
}

.ktg-project-cover-card::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 2;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(7, 20, 38, .03) 20%, rgba(7, 20, 38, .56) 100%);
}

.ktg-project-cover-fallback {
    z-index: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 1rem;
    color: rgba(255, 255, 255, .92);
}

.ktg-project-cover-fallback span {
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .16em;
    opacity: .7;
}

.ktg-project-cover-fallback strong {
    margin-top: .25rem;
    max-width: 85%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 18px;
    font-weight: 900;
    letter-spacing: -.02em;
}

.ktg-project-cover-badge {
    position: absolute;
    left: .75rem;
    bottom: .7rem;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 999px;
    padding: .25rem .55rem;
    background: rgba(8, 26, 48, .62);
    color: #fff;
    backdrop-filter: blur(8px);
    font-size: 8px;
    font-weight: 900;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.ktg-project-cover-controls {
    position: absolute;
    top: .65rem;
    right: .65rem;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: .4rem;
}

.ktg-project-cover-action-form {
    margin: 0;
}

.ktg-project-cover-control {
    display: inline-flex;
    min-height: 30px;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 9px;
    padding: .4rem .65rem;
    background: rgba(255, 255, 255, .92);
    color: #17365f;
    box-shadow: 0 4px 16px rgba(15, 23, 42, .16);
    cursor: pointer;
    font-size: 9px;
    font-weight: 900;
    line-height: 1;
    backdrop-filter: blur(8px);
}

.ktg-project-cover-control:hover {
    background: #fff;
}

.ktg-project-cover-control-danger {
    color: #be1e2d;
}

.ktg-project-cover-remove-form {
    display: none;
}

.ktg-project-cover-remove-form.is-visible {
    display: block;
}

/* Dashboard project hero: the image is a clear visual identity zone, not a watermark. */
.ktg-project-hero {
    isolation: isolate;
}

.ktg-project-hero-media {
    position: absolute;
    inset: 0 0 0 auto;
    z-index: 0;
    width: 52%;
    overflow: hidden;
    pointer-events: none;
    background: #eef3f8;
}

.ktg-project-hero-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 54% center;
    opacity: 0;
    transform: scale(1.015);
    filter: saturate(1.06) contrast(1.03);
    transition: opacity .3s ease, transform .5s ease;
}

.ktg-project-hero.has-project-cover .ktg-project-hero-image {
    opacity: .96;
}

.ktg-project-hero.has-project-cover:hover .ktg-project-hero-image {
    transform: scale(1.025);
}

.ktg-project-hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg,
            rgba(255, 255, 255, 1) 0%,
            rgba(255, 255, 255, .78) 14%,
            rgba(255, 255, 255, .34) 32%,
            rgba(255, 255, 255, .08) 58%,
            rgba(255, 255, 255, .02) 100%),
        linear-gradient(180deg, rgba(23, 54, 95, .03), rgba(23, 54, 95, .10));
}

.dark .ktg-project-hero-media {
    background: #0f172a;
}

.dark .ktg-project-hero-overlay {
    background:
        linear-gradient(90deg,
            rgba(15, 23, 42, 1) 0%,
            rgba(15, 23, 42, .80) 14%,
            rgba(15, 23, 42, .38) 34%,
            rgba(15, 23, 42, .10) 60%,
            rgba(15, 23, 42, .04) 100%),
        linear-gradient(180deg, rgba(15, 23, 42, .04), rgba(15, 23, 42, .18));
}

.ktg-project-hero > .grid,
.ktg-project-hero > .border-t {
    position: relative;
    z-index: 2;
}

.ktg-project-hero > .absolute.inset-x-0.top-0 {
    z-index: 3;
}

.ktg-project-hero.has-project-cover > .border-t {
    background-color: rgba(248, 250, 252, .90);
    backdrop-filter: blur(10px);
}

.dark .ktg-project-hero.has-project-cover > .border-t {
    background-color: rgba(2, 6, 23, .82);
}

@media (min-width: 1024px) {
    .ktg-project-hero > .grid {
        min-height: 160px;
    }

    .ktg-project-hero-media::after {
        content: '';
        position: absolute;
        inset: 0;
        box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04);
        pointer-events: none;
    }
}

@media (min-width: 640px) and (max-width: 1023px) {
    .ktg-project-hero-media {
        width: 48%;
    }

    .ktg-project-hero.has-project-cover .ktg-project-hero-image {
        opacity: .88;
    }

    .ktg-project-hero-overlay {
        background: linear-gradient(90deg, rgba(255, 255, 255, .98) 0%, rgba(255, 255, 255, .62) 25%, rgba(255, 255, 255, .10) 68%, rgba(255, 255, 255, .02) 100%);
    }

    .dark .ktg-project-hero-overlay {
        background: linear-gradient(90deg, rgba(15, 23, 42, .98) 0%, rgba(15, 23, 42, .68) 25%, rgba(15, 23, 42, .14) 68%, rgba(15, 23, 42, .04) 100%);
    }
}

@media (max-width: 639px) {
    .ktg-project-cover-card-featured {
        height: 128px;
    }

    .ktg-project-cover-card-compact {
        height: 96px;
    }

    .ktg-project-cover-badge {
        bottom: .55rem;
        left: .6rem;
        min-height: 22px;
        font-size: 7px;
    }

    .ktg-project-cover-controls {
        top: .5rem;
        right: .5rem;
    }

    .ktg-project-cover-control {
        min-height: 30px;
        padding: .38rem .55rem;
        font-size: 8px;
    }

    /* On phones the project image becomes a real banner above the executive content. */
    .ktg-project-hero-media {
        position: relative;
        inset: auto;
        width: 100%;
        height: 108px;
        background: #e9eff6;
    }

    .ktg-project-hero.has-project-cover .ktg-project-hero-image {
        opacity: .94;
    }

    .ktg-project-hero-image {
        object-position: center 45%;
        transform: scale(1.01);
    }

    .ktg-project-hero-overlay {
        background:
            linear-gradient(180deg,
                rgba(255, 255, 255, .02) 0%,
                rgba(255, 255, 255, .08) 42%,
                rgba(255, 255, 255, .72) 82%,
                rgba(255, 255, 255, .98) 100%),
            linear-gradient(90deg, rgba(23, 54, 95, .08), rgba(23, 54, 95, .01));
    }

    .dark .ktg-project-hero-overlay {
        background:
            linear-gradient(180deg,
                rgba(15, 23, 42, .04) 0%,
                rgba(15, 23, 42, .10) 42%,
                rgba(15, 23, 42, .74) 84%,
                rgba(15, 23, 42, .98) 100%),
            linear-gradient(90deg, rgba(15, 23, 42, .08), rgba(15, 23, 42, .01));
    }
}
