/* Project portfolio components
   Extends the shared site design without introducing a separate theme. */

.portfolio-section {
    padding: 2.75rem 0;
    border-top: 1px solid var(--border);
}

.portfolio-section:first-of-type {
    padding-top: 0;
    border-top: 0;
}

.portfolio-section + .portfolio-section {
    margin-top: .5rem;
}

.portfolio-section-header,
.section-heading {
    max-width: 760px;
    margin-bottom: 1.75rem;
}

.section-kicker {
    margin: 0 0 .55rem;
    color: var(--blue-light);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.portfolio-section h2,
.section-heading h2 {
    margin: 0;
    font-size: clamp(1.55rem, 3vw, 2rem);
    line-height: 1.2;
}

.section-description {
    max-width: 66ch;
    margin: .75rem 0 0;
    color: var(--text-secondary);
}

.portfolio-primary > .portfolio-section-header,
.portfolio-primary > .section-heading {
    padding-left: 1rem;
    border-left: 2px solid var(--purple);
}

.portfolio-secondary > .portfolio-section-header,
.portfolio-secondary > .section-heading {
    max-width: 680px;
}

.portfolio-secondary .section-kicker {
    color: var(--amber-light);
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.project-card {
    display: flex;
    min-width: 0;
    min-height: 250px;
    overflow: hidden;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    transition: border-color .15s ease, background-color .15s ease;
}

.project-card:hover {
    border-color: var(--purple);
}

.project-card-featured {
    grid-column: 1 / -1;
}

.portfolio-secondary .project-card {
    background: var(--surface-subtle);
}

.project-preview {
    position: relative;
    width: 100%;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border-bottom: 1px solid var(--border);
    background: var(--surface-subtle);
}

.project-preview img,
.project-preview picture {
    display: block;
    width: 100%;
    height: 100%;
}

.project-preview img {
    object-fit: cover;
}

.project-preview-placeholder {
    display: grid;
    min-height: 150px;
    padding: 1.25rem;
    place-items: center;
    border-bottom: 1px solid var(--border);
    background: var(--surface-subtle);
    color: var(--text-muted);
    font-size: .88rem;
    text-align: center;
}

.project-body {
    display: flex;
    min-width: 0;
    height: 100%;
    padding: 1.5rem;
    flex-direction: column;
}

.project-card h3 {
    margin: 0;
    font-size: 1.25rem;
    line-height: 1.3;
}

.project-card h3 a {
    color: var(--text-primary);
    text-decoration: none;
}

.project-card h3 a:hover {
    color: var(--purple-light);
}

.project-card p {
    margin: .75rem 0 0;
}

.project-meta {
    display: flex;
    margin: 0 0 .65rem;
    flex-wrap: wrap;
    align-items: center;
    gap: .35rem .7rem;
    color: var(--blue-light);
    font-size: .82rem;
    font-weight: 700;
}

.project-meta > * {
    color: inherit;
}

.project-meta > * + *::before {
    margin-right: .7rem;
    color: var(--text-muted);
    content: "·";
}

.project-tools {
    display: flex;
    margin: 1rem 0 0;
    padding: .85rem 0 0;
    flex-wrap: wrap;
    gap: .35rem .65rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: .82rem;
    list-style: none;
}

.project-tools li {
    color: inherit;
}

.project-tools li + li::before {
    margin-right: .65rem;
    color: var(--purple-light);
    content: "/";
}

.project-actions {
    display: flex;
    margin-top: auto;
    padding-top: 1.35rem;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem 1rem;
}

.project-link-secondary {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    color: var(--blue-light);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: transparent;
    text-underline-offset: .24em;
}

.project-link-secondary:hover,
.project-link-secondary:focus-visible {
    color: var(--text-primary);
    text-decoration-color: currentColor;
}

.project-empty {
    display: grid;
    min-height: 180px;
    padding: 1.75rem;
    align-content: center;
    border: 1px dashed var(--border);
    border-radius: 12px;
    background: var(--surface-subtle);
}

.project-empty h3 {
    margin: 0;
    font-size: 1.15rem;
}

.project-empty p {
    max-width: 60ch;
    margin: .65rem 0 0;
}

.portfolio-secondary .project-empty {
    min-height: 150px;
    background: transparent;
}

#media-design {
    scroll-margin-top: 1rem;
}

.project-grid--media {
    align-items: stretch;
}

.project-card--media {
    min-height: 0;
}

.project-card--media .project-preview {
    aspect-ratio: 4 / 3;
}

.project-preview--contain {
    display: grid;
    padding: 1rem;
    place-items: center;
    background: #0B1220;
}

.project-preview--contain img {
    object-fit: contain;
}

.project-card--media .project-body {
    padding: 1.35rem;
}

.project-detail {
    max-width: 1080px;
}

.project-article {
    width: 100%;
}

.project-detail-header {
    max-width: 800px;
    margin-bottom: 2.75rem;
}

.project-detail-header h1 {
    max-width: 17ch;
    font-size: clamp(2.2rem, 5vw, 3.6rem);
}

.project-lead {
    max-width: 65ch;
    margin: 1rem 0 0;
    color: var(--text-secondary);
    font-size: 1.08rem;
    line-height: 1.7;
}

.project-facts {
    display: grid;
    max-width: 760px;
    margin: 1.75rem 0 0;
    padding: 1rem 0;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.project-facts div {
    min-width: 0;
}

.project-facts dt {
    margin: 0 0 .3rem;
    color: var(--text-muted);
    font-size: .75rem;
    font-weight: 800;
    letter-spacing: .09em;
    text-transform: uppercase;
}

.project-facts dd {
    margin: 0;
    color: var(--blue-light);
    font-weight: 700;
}

.project-content-section {
    padding: 2.5rem 0;
    border-top: 1px solid var(--border);
}

.project-content-section > h2 {
    margin: 0 0 1rem;
    font-size: clamp(1.45rem, 3vw, 1.9rem);
}

.project-content-copy {
    max-width: 68ch;
    margin: 0 0 1.5rem;
}

.project-note {
    max-width: 72ch;
    margin: 1.5rem 0 0;
    padding: .9rem 1rem;
    border-left: 2px solid var(--amber);
    background: var(--amber-subtle);
    color: var(--text-secondary);
}

.media-gallery,
.document-pages {
    display: grid;
    margin: 1.5rem 0 0;
    padding: 0;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: start;
    list-style: none;
}

.media-gallery--single {
    max-width: 760px;
    grid-template-columns: minmax(0, 1fr);
}

.media-gallery--portrait {
    max-width: 720px;
}

.media-figure {
    margin: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--surface-subtle);
}

.media-figure img {
    display: block;
    width: 100%;
    height: auto;
}

.media-figure figcaption {
    padding: .7rem .85rem;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: .82rem;
}

.project-originals {
    display: flex;
    margin-top: 1.5rem;
    flex-wrap: wrap;
    gap: .75rem;
}

.project-originals .project-link-secondary {
    padding: 0 .25rem;
}

@media (min-width: 821px) {
    .project-card-featured {
        display: grid;
        min-height: 280px;
        grid-template-columns: minmax(260px, .85fr) minmax(0, 1.15fr);
    }

    .project-card-featured .project-preview,
    .project-card-featured .project-preview-placeholder {
        height: 100%;
        min-height: 280px;
        aspect-ratio: auto;
        border-right: 1px solid var(--border);
        border-bottom: 0;
    }

    .project-card-featured .project-preview--contain img {
        max-height: 520px;
    }
}

@media (max-width: 700px) {
    .portfolio-section {
        padding: 2.25rem 0;
    }

    .portfolio-section-header,
    .section-heading {
        margin-bottom: 1.35rem;
    }

    .project-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .project-card-featured {
        grid-column: auto;
    }

    .project-card {
        min-height: 0;
    }

    .project-body,
    .project-empty {
        padding: 1.3rem;
    }

    .project-detail-header {
        margin-bottom: 2.25rem;
    }

    .project-facts {
        grid-template-columns: minmax(0, 1fr);
        gap: .85rem;
    }

    .project-content-section {
        padding: 2rem 0;
    }

    .media-gallery,
    .document-pages {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 400px) {
    .project-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .project-actions .button-link,
    .project-actions .card-action,
    .project-link-secondary {
        width: 100%;
        justify-content: center;
    }
}
