/* Card-only styles for project presentation tiles */

.project-card {
    --project-card-width: 300px;
    --project-card-height: 358px;
    --project-card-image-height: 195px;
    --project-card-goal-color: var(--pp-card-goal-color, var(--theme-accent));
    --project-card-title-color: var(--pp-card-title-color, var(--theme-title));
    position: relative;
    z-index: 0;
    isolation: isolate;
    display: flex;
    flex-direction: column;
    width: var(--project-card-width);
    min-height: var(--project-card-height);
    height: var(--project-card-height);
    max-width: 100%;
    overflow: hidden;
    border: 1px solid var(--theme-border, #e3ddd3);
    border-radius: 10px;
    margin-bottom: 15px;
    background-color: var(--theme-surface);
    color: var(--theme-text);
}

.project-card__bookmark {
    position: absolute;
    bottom: 6px;
    left: 6px;
    z-index: 60;
    width: 24px;
    height: 24px;
    border: 1px solid var(--theme-border, #e3ddd3);
    border-radius: 50%;
    background: color-mix(in srgb, var(--theme-surface, #ffffff) 18%, transparent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--theme-text, #1f2937);
    text-decoration: none;
    padding: 0;
    transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.project-card__bookmark:hover {
    background: color-mix(in srgb, var(--theme-surface, #ffffff) 58%, transparent);
    border-color: color-mix(in srgb, var(--theme-accent, #1f2937) 38%, var(--theme-border, #e3ddd3));
    color: var(--theme-accent, #1f2937);
}

.project-card__bookmark:disabled,
.project-card__bookmark.is-loading {
    opacity: 0.68;
    cursor: default;
    pointer-events: none;
}

.project-card__bookmark .bookmarkIcon {
    width: 13px;
    height: 13px;
}

.project-card__bookmark .bookmarkIcon.filled {
    display: none;
}

.project-card__bookmark.isBookmarked .bookmarkIcon.filled {
    display: inline;
}

.project-card__bookmark.isBookmarked .bookmarkIcon.notFilled {
    display: none;
}

.project-card .goal {
    color: var(--project-card-goal-color);
    margin: 0;
    font-size: var(--project-card-goal-font-size, 17px);
    font-weight: bold;
    line-height: 1.24;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.project-card .title {
    margin: 0;
    line-height: 1.2;
    font-size: var(--project-card-title-font-size, 17px);
    font-weight: bold;
    color: var(--project-card-title-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.project-card .keywords {
    font-size: 15px;
    font-weight: bold;
    line-height: 1.2em;
    color: var(--project-card-goal-color);
}

.project-card .image-container {
    height: var(--project-card-image-height);
    padding: 10px;
    margin-bottom: 8px;
}

.project-card .image-container.has-image {
    background-color: transparent;
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid var(--theme-border);
}

html[data-theme="dark"] .project-card .image-container.has-image,
html[data-theme="neon"] .project-card .image-container.has-image,
html[data-theme="matrix"] .project-card .image-container.has-image,
html[data-theme="luxury-black"] .project-card .image-container.has-image,
html[data-theme="deep-ocean"] .project-card .image-container.has-image {
    background-color: var(--theme-surface-alt);
}

.project-card .image-container img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 6px;
    object-fit: cover;
}

.project-card__fallback {
    height: 100%;
    width: 100%;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--theme-surface-alt, #f4f4f4);
    border: 1px dashed var(--theme-border, #e3ddd3);
    color: var(--theme-accent, #6b5bd6);
    text-transform: uppercase;
}

.project-card__fallback-letter {
    font-size: 64px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.02em;
}

.project-card__fallback-text {
    color: var(--theme-text-muted, #7f7f7f);
    font-size: 0.9rem;
}

.project-card .image-container img[src*="/pp/logos/"] {
    object-fit: contain;
    width: auto;
    height: auto;
    max-width: 80%;
    max-height: 100%;
    margin: 0 auto;
    padding: 6px;
    border-radius: 8px;
    border: 1px solid var(--pp-logo-chip-border, var(--theme-border, #e3ddd3));
    background-color: var(--pp-logo-chip-bg, var(--theme-surface, #ffffff));
    box-sizing: border-box;
}

@supports selector(.image-container:has(img)) {
    .project-card .image-container:has(img[src*="/pp/logos/"]) {
        display: flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        height: calc(var(--project-card-image-height) - 8px);
        margin: 8px 10px 8px;
        padding: 6px;
        border: 1px solid var(--theme-border, #e3ddd3);
        border-radius: 10px;
        background-color: color-mix(in srgb, var(--theme-surface) 70%, var(--theme-bg, #ffffff));
    }

    html[data-theme="dark"] .project-card .image-container:has(img[src*="/pp/logos/"]),
    html[data-theme="neon"] .project-card .image-container:has(img[src*="/pp/logos/"]),
    html[data-theme="matrix"] .project-card .image-container:has(img[src*="/pp/logos/"]),
    html[data-theme="luxury-black"] .project-card .image-container:has(img[src*="/pp/logos/"]),
    html[data-theme="deep-ocean"] .project-card .image-container:has(img[src*="/pp/logos/"]) {
        --pp-logo-chip-bg: color-mix(in srgb, var(--theme-text) 92%, var(--theme-surface));
        --pp-logo-chip-border: color-mix(in srgb, var(--theme-text) 50%, var(--theme-border));
        background-color: var(--theme-surface-alt);
    }
}

.goal-container {
    margin: 0 10px 8px;
    padding: 8px 9px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 5px;
    min-height: 88px;
    border: 1px solid var(--theme-border, #e3ddd3);
    border-radius: 8px;
    background: var(--theme-surface, #ffffff);
    overflow: hidden;
    min-width: 0;
}

.goal-container .title,
.goal-container .goal {
    margin: 0;
}

.collection-container .other-info-container {
    position: static;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    width: auto;
    margin-top: auto;
    padding: 0 13px 8px 9px;
    color: var(--theme-text-muted);
    font-size: 14px;
    gap: 6px;
}

.collection-container .other-info-container .stats {
    display: inline-flex;
    align-items: center;
}

.stat-chunk {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-right: 5px;
}

.stat-chunk:last-child {
    margin-right: 0;
}

.pp-card-stat-icon-image {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.project-card .pp-card-stat-icon-image.icon-themed {
    filter: brightness(0) saturate(100%) var(--project-card-stat-icon-filter, var(--theme-icon-filter));
}

.project-card:hover {
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.16);
}

html[data-theme="retro-game"] .project-card .goal,
html[data-theme="retro-game"] .project-card .keywords {
    color: #1f8f43;
}

html[data-theme="retro-game"] .project-card .goal {
    color: var(--theme-sky);
}

@media screen and (max-width: 810px) {
    .project-card {
        --project-card-width: clamp(206px, 44vw, 228px);
        --project-card-height: auto;
        --project-card-image-height: 136px;
        min-height: 0;
        height: auto;
        padding-top: 0;
        margin-right: 0;
        margin-bottom: 0;
    }

    .project-card .goal {
        line-height: 1.2;
        font-size: var(--project-card-goal-font-size-tablet, 14px);
    }

    .project-card .title {
        font-size: var(--project-card-title-font-size-tablet, 14.5px);
    }

    .project-card .image-container {
        margin-bottom: 6px;
        padding: 8px;
    }

    .goal-container {
        margin: 0 8px 6px;
        padding: 7px 8px;
        min-height: 0;
    }

    @supports selector(.image-container:has(img)) {
        .project-card .image-container:has(img[src*="/pp/logos/"]) {
            height: calc(var(--project-card-image-height) - 8px);
            margin: 6px 8px;
            padding: 6px;
        }
    }

    .collection-container .other-info-container {
        font-size: 12px;
        padding: 0 8px 8px;
    }
}

@media screen and (max-width: 580px) {
    .project-card {
        --project-card-width: clamp(220px, 78vw, 258px);
        --project-card-image-height: 142px;
        border-radius: 12px;
    }

    .project-card .goal {
        font-size: var(--project-card-goal-font-size-mobile, 14.5px);
    }

    .project-card .title {
        font-size: var(--project-card-title-font-size-mobile, 14.5px);
    }

    .project-card__bookmark {
        bottom: 8px;
        left: 8px;
        width: 27px;
        height: 27px;
    }

    .project-card__bookmark .bookmarkIcon {
        width: 14px;
        height: 14px;
    }

    .collection-container .other-info-container {
        font-size: 12px;
        padding: 0 9px 9px;
    }
}
