/* Project cards (list) */
.project-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 1.25rem;
}

a.project-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    background:
        radial-gradient(80% 70% at 100% 0%, rgba(237, 28, 36, 0.08) 0%, transparent 60%),
        var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.375rem 1.5rem 1.25rem;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}
.project-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: var(--brand-gradient);
    opacity: 0.85;
}

a.project-card:hover {
    border-color: var(--brand-primary-light);
    box-shadow: var(--shadow-md);
    text-decoration: none;
    color: inherit;
}

a.project-card:active {
    transform: translateY(1px);
}

.project-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.project-card, .timeline-card { min-width: 0; overflow-wrap: anywhere; }
.project-timeline .timeline-markdown img { max-width: 100%; height: auto; }
.project-timeline .timeline-markdown table { display: block; max-width: 100%; overflow-x: auto; }

.project-card-title {
    font-family: var(--font-display);
    font-size: 1.1875rem;
    font-weight: 750;
    letter-spacing: -0.015em;
    margin: 0;
    line-height: 1.3;
    color: var(--text-primary);
}

.project-card-desc {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin: 0 0 1rem;
    line-height: 1.5;
    flex-grow: 1;
}

.project-card-meta {
    display: grid;
    gap: 0.5rem;
    margin: 0 0 1rem;
    font-size: 0.8125rem;
}

.project-card-meta dt {
    font-size: var(--fs-2xs);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin: 0;
}

.project-card-meta dd {
    margin: 0.125rem 0 0;
    color: var(--text-secondary);
}

.project-card-cta {
    margin-top: auto;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--brand-primary);
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    white-space: nowrap;
}

.status-planned {
    background: #F2F2F2;
    border-color: #D4D4D4;
    color: #A33034;
}

.status-inprogress {
    background: #ecfdf5;
    border-color: #a7f3d0;
    color: #065f46;
}

.status-completed {
    background: #F4F4F4;
    border-color: #D4D4D4;
    color: #404040;
}

.status-onhold {
    background: #fef3c7;
    border-color: #fde68a;
    color: #92400e;
}

/* Client project timeline */
.project-timeline .timeline-vertical {
    position: relative;
    padding-left: 1.75rem;
}

.project-timeline .timeline-vertical::before {
    content: "";
    position: absolute;
    left: 0.4375rem;
    top: 0.25rem;
    bottom: 0.25rem;
    width: 2px;
    background: linear-gradient(180deg, var(--brand-primary-light) 0%, var(--border) 60%);
}

.project-timeline .timeline-event {
    position: relative;
    padding-bottom: 1.25rem;
}

.project-timeline .timeline-event:last-child {
    padding-bottom: 0;
}

.project-timeline .timeline-marker {
    position: absolute;
    left: -1.75rem;
    top: 0.85rem;
    width: 0.875rem;
    height: 0.875rem;
    border-radius: 50%;
    background: var(--surface);
    border: 2px solid var(--brand-primary);
    box-shadow: 0 0 0 4px var(--accent-red-bg);
    z-index: 1;
}

.project-timeline .timeline-card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    padding: 1rem;
    background: var(--surface);
}

.project-timeline .timeline-card-collapsed .timeline-card-header {
    margin-bottom: 0;
}

.project-timeline .timeline-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.project-timeline .timeline-toggle {
    color: var(--text-muted);
    line-height: 1;
    margin-top: 0.15rem;
    flex-shrink: 0;
}

.project-timeline .timeline-toggle:hover,
.project-timeline .timeline-toggle:focus {
    color: var(--text-primary);
}

.project-timeline .timeline-header-main {
    color: inherit;
    text-decoration: none;
    min-width: 0;
}

.project-timeline .timeline-header-main:hover,
.project-timeline .timeline-header-main:focus {
    color: inherit;
    text-decoration: none;
}

.project-timeline h3.timeline-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.35;
}

.project-timeline .timeline-meta {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 0.125rem;
}

.project-timeline .timeline-body {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.project-timeline .timeline-markdown :first-child {
    margin-top: 0;
}

.project-timeline .timeline-markdown :last-child {
    margin-bottom: 0;
}

.project-timeline .timeline-markdown p {
    margin: 0 0 0.75rem;
    line-height: 1.55;
}

.project-timeline .timeline-markdown ul,
.project-timeline .timeline-markdown ol {
    margin: 0 0 0.75rem 1.25rem;
    padding: 0;
}

.project-timeline .timeline-markdown h1,
.project-timeline .timeline-markdown h2,
.project-timeline .timeline-markdown h3,
.project-timeline .timeline-markdown h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0.75rem 0 0.35rem;
}

.project-timeline .timeline-markdown a {
    color: var(--brand-primary);
    text-decoration: underline;
}

.project-timeline .timeline-markdown code {
    font-family: ui-monospace, Consolas, monospace;
    font-size: 0.88em;
    background: var(--surface-alt);
    padding: 0.15em 0.35em;
    border-radius: 0.25rem;
}

.project-timeline .timeline-markdown pre {
    background: var(--surface-alt);
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    padding: 0.75rem;
    overflow-x: auto;
    margin: 0.5rem 0 0.75rem;
}

.project-timeline .timeline-markdown .mermaid {
    display: block;
    margin: 0.75rem 0;
    overflow-x: auto;
    text-align: center;
}

.project-timeline .timeline-links,
.project-timeline .timeline-files {
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.project-timeline .timeline-links li,
.project-timeline .timeline-files li {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.25rem;
}

.project-timeline .filter-bar .search-input {
    position: relative;
    display: flex;
    align-items: center;
}

.project-timeline .filter-bar .search-input .bi-search {
    position: absolute;
    left: 0.75rem;
    color: var(--text-muted);
    pointer-events: none;
    z-index: 1;
}

.project-timeline .filter-bar .search-input .form-control {
    padding-left: 2.25rem;
}
