/* =========================================================================
   projects.css — shared styles for /projects/ index (grid) and
   /projects/<slug>/ detail pages.

   The index page is a 2-column responsive grid of clickable image cards.
   Each card scales slightly on hover and links to its own markdown-driven
   detail page.

   The detail page renders a hero image at the top, the project name, and
   the markdown content fetched from project.md.
   ========================================================================= */

/* ----- Grid (index page) ----- */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 40px 28px;
    max-width: 1050px;
    margin: 0 auto;
    padding: 60px 0 100px;
    width: 100%;
}

.project-card {
    display: block;
    text-decoration: none;
    color: inherit;
    overflow: hidden;
}

.project-card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #f5f5f7;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: transform 450ms cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 450ms cubic-bezier(0.4, 0, 0.2, 1);
}

.project-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.project-card-image-placeholder {
    background: linear-gradient(135deg, #f5f5f7 0%, #e8e8ed 100%);
    color: #6e6e73;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.project-card:hover .project-card-image {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.project-card-title {
    margin-top: 18px;
    font-size: 22px;
    font-weight: 400;
    letter-spacing: -0.005em;
    line-height: 1.3;
    color: #1d1d1f;
}

.project-card-subtitle {
    margin-top: 6px;
    font-size: 14px;
    color: #6e6e73;
    letter-spacing: 0.02em;
}

/* ----- Detail page ----- */
.project-detail {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 0 80px;
}

.project-hero {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 12px;
    margin-bottom: 40px;
    background: #f5f5f7;
}

.project-detail h1 {
    font-size: 42px;
    font-weight: 400;
    letter-spacing: -0.01em;
    line-height: 1.15;
    margin-bottom: 12px;
    color: #1d1d1f;
}

.project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    margin-bottom: 32px;
    font-size: 13px;
    color: #6e6e73;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.project-meta-tag {
    padding: 4px 10px;
    background: #f5f5f7;
    border-radius: 999px;
}

/* Markdown content on the detail page reuses the same styling as /about/ */
.project-detail .markdown-body { line-height: 1.7; font-size: 18px; }
.project-detail .markdown-body p { margin: 0 0 18px; }
.project-detail .markdown-body h2 {
    font-size: 28px; font-weight: 400;
    letter-spacing: -0.005em; margin: 48px 0 16px;
    padding-bottom: 8px; border-bottom: 1px solid #d1d1d6;
}
.project-detail .markdown-body h3 {
    font-size: 22px; font-weight: 400;
    margin: 36px 0 12px;
}
.project-detail .markdown-body ul,
.project-detail .markdown-body ol { margin: 0 0 18px 28px; }
.project-detail .markdown-body li { margin-bottom: 6px; }
.project-detail .markdown-body a {
    color: #0071e3;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.project-detail .markdown-body code {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: 0.92em;
    background: #f5f5f7;
    padding: 2px 6px;
    border-radius: 4px;
}
.project-detail .markdown-body pre {
    background: #f5f5f7;
    border-radius: 8px;
    padding: 16px 20px;
    overflow-x: auto;
    margin: 0 0 18px;
}
.project-detail .markdown-body pre code {
    background: transparent;
    padding: 0;
    border-radius: 0;
    font-size: 0.88em;
    line-height: 1.6;
}
.project-detail .markdown-body blockquote {
    border-left: 3px solid #d1d1d6;
    padding: 4px 0 4px 20px;
    margin: 0 0 18px;
    color: #6e6e73;
}
.project-detail .markdown-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 24px 0;
    border-radius: 8px;
}
.project-detail .markdown-body hr {
    border: 0;
    border-top: 1px solid #d1d1d6;
    margin: 40px 0;
}

@media (max-width: 768px) {
    .projects-grid {
        grid-template-columns: 1fr;
        gap: 28px;
        padding: 40px 0 60px;
    }
    .project-card-title { font-size: 19px; }
    .project-detail { padding: 40px 0 60px; }
    .project-detail h1 { font-size: 28px; }
    .project-hero { margin-bottom: 28px; }
}