/* Action row under the project grid; gives the show-more button clear separation from the cards. */
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.35rem;
}

/* Header row: section heading on the left, search-and-filter toggle on the right. */
.portfolio-section-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

/* Collapsible filter panel that sits between the section header and the project grid. */
.portfolio-filter-panel {
    margin-bottom: 1.25rem;
    padding: 1rem;
    border-radius: var(--radius-md);
    background: var(--surface-alt);
    border: 1px solid var(--border);
}

.portfolio-search-row {
    display: grid;
    gap: 0.85rem;
    margin-bottom: 0.85rem;
}

.portfolio-search-input {
    width: 100%;
    padding: 0.9rem 1rem;
    border-radius: 16px;
    border: 1px solid var(--border-strong);
    background: var(--surface);
    color: var(--text);
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
}

.tag-button {
    display: inline-flex;
    align-items: center;
    padding: 0.55rem 0.8rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--muted);
    cursor: pointer;
}

.tag-button.is-active {
    background: var(--accent-soft);
    border-color: rgba(47, 111, 237, 0.22);
    color: var(--accent-strong);
}

/*
    Single project grid.
    Default: 3-column featured view.
    .is-expanded: 2-column full-archive view.
*/
.project-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}


/* Clickable tag chips inside project cards. */
.card-tag {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    padding: 0.4rem 0.65rem;
    border-radius: 999px;
    font-size: 0.88rem;
    color: var(--muted);
    background: var(--surface-alt);
    border: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
}

.card-tag:hover {
    border-color: var(--accent);
    color: var(--accent-strong);
}

.card-tag.is-active {
    background: var(--accent-soft);
    border-color: rgba(47, 111, 237, 0.22);
    color: var(--accent-strong);
}

/* Reusable project card used in both grid modes. */
.project-card {
    display: grid;
    gap: 1rem;
    padding: 1rem;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    color: inherit;
    text-decoration: none;
    height: 100%;
}

.project-card:hover,
.project-card:focus-visible {
    transform: translateY(-2px);
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
}

.project-card-image {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: calc(var(--radius-md) + 2px);
    background: var(--surface-alt);
}

.project-card-content {
    display: grid;
    gap: 0.8rem;
}

.project-card h3 {
    margin: 0;
    font-size: 1.18rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-card p {
    margin: 0;
    color: var(--muted);
}

.project-card-meta {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.5rem;
    scrollbar-width: none;
    cursor: grab;
}

.project-card-meta.is-dragging {
    cursor: grabbing;
    user-select: none;
}

.project-card-meta::-webkit-scrollbar {
    display: none;
}


.no-results {
    margin: 0;
    color: var(--muted);
}

@media (max-width: 960px) {
    .project-grid,
    .project-grid.is-expanded {
        grid-template-columns: 1fr;
    }

    .portfolio-section-top {
        flex-wrap: wrap;
    }
}
